Hello!
I wish to know if it's possible in C++ to somehow handle the following situations:
Situation 1) (Easily handled)
class BasicFacility { }
template <typename U1, typename U2> class Facility : public BasicFacility { }
Suppose now that we want to have some compilation-time assertion and we want to check if the arbitrary type typename T
models the Facility
. This is pretty simple:
(boost::is_base_of<BasicFacility, T>::type)
Situation 2) (???)
Now let's assume that in the same situation we just have our template class:
template <typename U1, typename U2> class Facility { }
Obviously we can't use the same solution from situation one, because we can't write statement<Facility, T>
(Facility
is a template itself).
So, is there a way (maybe, dirty, involving ugly casts, alignment-specific, ANYTHING that might work) to check if some T
actually equals some template type
without introducing specific empty (auxiliary) base classes (because sometimes you simply can't) ?
Thank you.