typename keyword in C++: Syntax and Examples

typename is used to replace class keyword in template or generic class declaration:

template <typename T> class class_name {


It is also used to inform compiler that there is a typename declared and not an object name.

For Example:

typename T::Name Object;

Leave a Reply