Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: do not use non-static class member for constant value #1134

Merged
merged 1 commit into from Feb 21, 2022

Conversation

addaleax
Copy link
Member

Non-static class members need to be set for each instantiated
object and take up extra space, which is why constant data
is generally provided through static members or static functions
(and static functions are a bit easier to use in header-only C++11).

Non-static class members need to be set for each instantiated
object and take up extra space, which is why constant data
is generally provided through static members or static functions
(and static functions are a bit easier to use in header-only C++11).
Copy link
Member

@NickNaso NickNaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@addaleax addaleax merged commit 5790c55 into main Feb 21, 2022
@addaleax addaleax deleted the no-extra-const-member branch February 21, 2022 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants