This is known as a specified type specifier and is usually only required when your class name is "obscured" or "hidden" and you need to be explicit.
class T
{
};
T T;
T T2;
If your compiler is smart, it will give you the following warnings:
main.cpp:15:5: error: must use 'class' tag to refer to type 'T' in this scope
T T2;
^
class
main.cpp:14:7: note: class 'T' is hidden by a non-type declaration of 'T' here
T T;
^
, .
:
template <typename T>
void Method()
{
using type = typename T::value_type;
}
Method<class T>();
.
class T
{
public:
using value_type = int;
};
Method<T>();
Method<class T>();