...
In this noncompliant code example, the variable v
is defined in an unnamed namespace within a header file, and an inline function, get_v()
, is defined, which accesses that variable. Using ODR-using the inline function from multiple translation units (as shown in the implementation of f()
and g()
) violates the one-definition rule because the definition of get_v()
is not identical in all translation units (due to referencing a unique v
in each translation unit).
...