The first is the (non-template) member function of the class template< typename T, typename functor > class className . The second is the template template member function template template <typename T> class className , for example:
Firstly:
template <typename T, class Functor > class ClassName { ReturnType functionName( Functor f ); };
Secondly:
template <typename T> class ClassName { template <typename Functor> ReturnType functionName( Functor f ); };
You say you don’t understand this, but you seem to have learned the essential: in the second case, the template class has only one parameter, but even after creating the instance (definition of type T ), the member function remains a template that can be created by several types. And since this is a function template, the template argument is a deduction, so you do not need to specify a type; the compiler will figure it out when you call the function.
source share