我尝试了下面的模板特化。
然而,这给我带来了编译错误:
你能告诉我如何解决这个问题吗?
我尝试了下面的模板特化。
#include<iostream>
using namespace std;
template<class T1, class T2>
T1 something(T2 a);
template<class T2>
double something(T2 a){
double b;
return b;
}
int main(){
something<double, double>(0.0);
}
然而,这给我带来了编译错误:
In function `main':
test.cpp:(.text+0x9): undefined reference to `double something<double, double>(double)'
你能告诉我如何解决这个问题吗?