这里有这样的函数定义:
template<>
template<>
void object::test<1>()
{
}有两个template<>是什么意思?
编辑:
我提取了对此示例有效的代码:
#include <iostream>
template <class U>
class A {
template <int n>
void test() {
}
};
template <class T>
class B {
public:
typedef A<T> object;
};
typedef B<int>::object object;
template<>
template<>
void object::test < 1 > () {
}
int main() {
return 0;
} 此代码在g++下编译。
来源:TUT test framework
https://stackoverflow.com/questions/7794207
复制相似问题