我的问题如下。
这是我的方法:
这些专业领域工作得不错:
但是这些不行:
1.
所以我的问题是: 如何使用模板类来专门化一个模板?
template<class T>
T my_function();
这些专业领域工作得不错:
template<>
int my_function(); //my_function<int>();
template<>
float my_function(); //my_function<flot>();
...
但是这些不行:
1.
template<>
template<class T>
std::list<T> my_function(); //my_function<std::list<class T> >();
2.
template<class T>
template<>
std::vector<T> my_function(); //my_function<std::vector<class T> >();
I get the error:
too many template-parameter-lists
所以我的问题是: 如何使用模板类来专门化一个模板?