C++ keyword: typename
From cppreference.com
The typename keyword is a hint to the compiler that the name following it is a type. It can also be used as a synonym for class keyword in template parameter lists to emphasize that the template can be passed a built-in type or struct. In some places the keyword is optional when the compiler can easily infer that the identifier is a type.
Usage
- In a template declaration, typename can be used as an alternative to class to declare type template parameters and template template parameters(since C++17).
- Inside a declaration or a definition of a template, typename can be used to declare that a dependent qualified name is a type.
- Inside a declaration or a definition of a template,(until C++11) typename can be used before a non-dependent qualified type name. It has no effect in this case.
- Inside a requirements for type requirements (since C++20)
- The type inside the angle brackets of a static_cast, const_cast, dynamic_cast, or reinterpret_cast can use typename
- The type named by an operator new expression can use typename