Let's say I have:
template <typename...>
class Foo { };
Then I define another function:
template <typename... T>
void Bar(const T&... arguments) { }
How do I check if all T
s passed to Bar
are all instantiated from Foo
? Like:
Foo<int> a;
Foo<int, int> b;
Bar(a, b); // OK
int c;
Bar(a, b, c); // ill-formed
I want a way to detect ill-formed arguments like Bar(a, b, c);
Is there a way to do this?