Given is a class 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 to restrict MyClass
to only allow a T
that is a derived type of MySecondClass
. I already know I need something like
template<typename T, typename = std::enable_if<std::is_base_of<MySecondClass<?,?>, T>::value>>
class MyClass
{
//...
}
I am just not sure what to put in for the ?
as I want to allow all possible MySecondClass
's.