

Modern C++ Basics - Programming in Mutiple Files
Linker Errors: The Universe's Way of Saying 'Try Header Guards Again'
views
| comments
inline namespace#
namespace {
namespace impl_v1 {
}
inline namespace impl_v2 {
}
}
cppinline#
- With the rapid development of compiler optimization, compilers today basically don’t care whether you use
inline
or not. - Since C++17, inline variables are introduced.
- We’ve said that global variables should also split declaration and definition;
- So inline variables can be directly put into headers, and only needs to be ODR in each TU.
- However, inline functions / variables may cause double symbols in shared libraries.