...
Code Block | ||||
---|---|---|---|---|
| ||||
// a.h #ifndef A_HEADER_FILE #define A_HEADER_FILE namespace { int v; } inline int get_v() { return v; } #endif // A_HEADER_FILE // a.cpp #include "a.h" void f() { int i = get_v(); // ... } // b.cpp #include "a.h" void g() { int i = get_v(); // ... } |
See MSC52-CPP. Obey the One Definition Ruleone-definition rule for more information on violations of the One Definition Rule.
...
Bibliography
[ISO/IEC 14882-2014] | Subclause 3.2, "One Definition Rule" |
...