#const variables internal linkage
5 messages · Page 1 of 1 (latest)
When your question is answered use !solved or the button below to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
So you can define constants in header files without violating ODR.
When you include that header file in many .cpp files, it’s local to the current translation unit (basically, the .cpp file thats being compiled + all its included headers)
Afaik C++17(11?14?) introduces a new meaning for inline that indicates to the linker that an identifier is allowed to be defined in multiple translation units and that the definition will be the same everywhere.
Const variables are implicitly inline