The specified MyClass with one template parameter
template<typename T> class MyClass {
and another class MySecondClass with two template parameters.
template<typename T, typename U> class MySecondClass {
What I would like to do is restrict MyClass only allow T , which is a derived type of MySecondClass . I already know that I need something like
template<typename T, typename = std::enable_if<std::is_base_of<MySecondClass<?,?>, T>::value>> class MyClass {
I'm just not sure what to add in ? since I want to allow all possible MySecondClass .
c ++ inheritance templates derived-class
user1056903
source share