From How to check if an object is an instance of a template class of multiple template arguments in C++? I got the following trait to check whether a type is a particular template instantiation of a templated type of several template arguments:
template <typename T1, typename T2>
struct A
{
};
template <typename Type>
struct IsA: std::false_type
{
};
template <typename T1, typename T2>
struct IsA<A<T1, T2>> : std::true_type
{
};
How would one additionally add the condition that the second type T2 fulfills some other condition?
I tried doing
template <typename Type>
struct IsA: std::false_type
{
};
template <typename T1, typename T2, std::enable_if_t<SomeCondition<T2>::value>>
struct IsA<A<T1, T2>> : std::true_type
{
};
but am getting the error
error: template parameters not deducible in partial specialization: