Hi,
Consider the following example:
Does the function "foo" violate Rule 6.2.1 in this context, given that kFoo is not a C++17 inline variable?
Or would it violate 6.2.1 only if kFoo were ODR-used (for example, passed by reference)?
Thanks!
Consider the following example:
Code:
// foo.h
constexpr int kFoo = 123;
inline int foo(int x)
{
return x * kFoo;
}
// tu1.cpp
#include "foo.h"
int tu1() { return foo(1); }
// tu2.cpp
#include "foo.h"
int tu2() { return foo(2); }
Does the function "foo" violate Rule 6.2.1 in this context, given that kFoo is not a C++17 inline variable?
Or would it violate 6.2.1 only if kFoo were ODR-used (for example, passed by reference)?
Thanks!