Is it possible to catch only classes that have a specific template argument, i.e., something like this:
template< typename T >
void foo( T<int> )
{
// do something
}
Yes, but you have to use a template template
argument
template <template <typename> class T>
void foo( T<int> )
{
// do something
}
You can also write
template <typename...> class T
to intercept a type T
that receive zero or more type parameters (example: to intercept std::vector
that receive two type where the second is with a default value).