Make C++ fail compilation on specific instantiation of template function explains how to make compilation to fail if a function is instantiated with a specific class, but not how to do so with a class.
Say I have a class :
template<class T>
class foo;
And another class Bar
. How would I make compilation fail if foo is instantiated or specialized with Bar
?
All solutions are like run-time (even though evaluation is at compile time the error can only be given at run- time which is not suitable).