函数模板:max(T a, T b){return (a > b)?a: b;}max<int>(a, b); // Yeah, the "<int>" is optional most of the time.但是如果你允许,我们可以这样写模板:
T max<class T>(T a, T b){return (a > b)?因此,我们</e
正如我们所知道的,在使用模板类型参数的类型成员之前,我们必须保留typename,因为如果没有它,编译器就不知道我们是在访问类型成员还是在使用静态数据成员,因为类模板的定义还没有出现(实例化)。() T::type x{}; // error: need a typename }
直到这里都还可以::value_t