You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SF.2 has a list under "A header file must contain only" that does not include:
static inline class member variables (not just functions)
inline variables not in a class declaration (again, not just functions)
Both are supported since C++17, resulting in all translation units linking the entity to the same memory location, The first point above results in code simplification and allows implementation of header-only classes that would otherwise not be possible. In [https://en.cppreference.com/w/cpp/language/inline](inline specifier - cppreference.com):
An inline function or variable(since C++17) ... has the same address in every translation unit.
The memory location of staticInlineMember is always the same, when that header is included in multiple source files. So is the location of inlineVariable.
The text was updated successfully, but these errors were encountered:
SF.2 has a list under "A header file must contain only" that does not include:
static inline
class member variables (not just functions)inline
variables not in a class declaration (again, not just functions)Both are supported since C++17, resulting in all translation units linking the entity to the same memory location, The first point above results in code simplification and allows implementation of header-only classes that would otherwise not be possible. In [https://en.cppreference.com/w/cpp/language/inline](inline specifier - cppreference.com):
For example, if a header includes:
The memory location of
staticInlineMember
is always the same, when that header is included in multiple source files. So is the location ofinlineVariable
.The text was updated successfully, but these errors were encountered: