Consider the following snippet as if it were written in the header file:
struct Foo {
};
template <class... Args>
Foo makeFoo(Args &&... args) {
return {std::forward<Args>(args)...};
}
I can call makeFoowith some parameters and return a Foo. Fine.
Now what I want to do is replace some of the arguments with makeFootags that look the same (still in the header file):
constexpr struct tag_type { using type = ActualType; } tag;
These tags must be discovered internally makeFooand replaced with actual objects before calling the constructor Foo. So the call will look like this:
auto myFoo = makeFoo("hi", ::tagBar, 42, ::tagBaz);
But here's the catch: this way of declaring my tags is very convenient, but if I use ODR using any of them, I need to give a definition somewhere else. Not very convenient.
And in accordance with this convenient specific answer (my attention):
" odr", , . , , , , , ,
... .
ODR, , ?