在声明一个 template type parameter(模板类型参数)的时候,cla 和 typename 意味着完全相同的东西。一些程序员更喜欢在所有的时间都用 cla,因为它更容易输入。
基于96个网页-相关网页
声明一个模板类型参数 Declares a template type parameter
模板非类型参数 template nontype parameter ; template non-type arguments
非类型模板参数 non-type template parameters
无类型模板参数 non-type template parameters
当要将某个模板类型参数用作基类列表中的模板参数时,必须显式地将该模板类型参数添加到模板类名中。
You must explicitly add the template type parameters to the template class name when using it as a template parameter in a base class list.
图6 .创建一个整数类型的模板参数。
图5 .创建一个类类型的模板参数。
应用推荐