C++Template的定义方法为:template<class T>...或者是template<typename T>...
template<class T>...
template<typename T>...
在模板定义语法中两者是一样的。
但是typename有另外一个用法:使用嵌套依赖类型
typedef typename T::LengthType LengthType;
对于T::LengthType
可以标记模板参数是一种类型,而非类的静态成员
C++模板中class与typename区别
原文:https://www.cnblogs.com/togepizzz/p/12570342.html