[英]How to specialize template template parameter for a class?
我有一个模板课
template <class T>
struct TypeText {
static const char *text;
};
以及“文本”成员的几个专业化:
template <> const char* TypeText<int>::text = "INT";
template <> const char* TypeText<long>::text = "LONG";
如何在没有有关A
和B
先验知识的情况下为std::vector<A,B>
实现专门化? 是否可以将std::vector<A,B>
与SomeOtherClass<A,B>
?
以下内容不起作用:
template <>
template <class T, class A>
const char* TypeText< std::vector<T,A> >::text = "vector";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.