You can use class
or typename
in template parameters and they are equivalent, so the following two classes are exactly the same:
template <class T> class C1 { T t_; };
template <typename T> class C1 { T t_; };
As a matter of personal choice, I tend to use class
for a template parameter that can only be a class because the template refers to a member.
template <class T> class C2 { T t_; public: void f() { t_.f(); } };
And I use typename
for a parameter that is not used in this way. I feel it is a useful hint as to what kind of parameter is expected.