[英]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.