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).
typename (you can also use class, but I think typename is more clear) inside < > say that T is a template class with a typename argument; by example if you write template <typename, std::size_t> class A, you ask for a template class A that need a type and a std::size_t value as template argument (like std::array).