高分!!!这是一个很牛逼的问题奥!!!跪求大侠赐教!
VC6.0下编译下面的代码居然报错!
代码:
template <typename A, typename B>
A Cast(const B& a)
{
return a;
}
int main()
{
double (*cast)(const int& a) = Cast<double, int>;
return 0;
}
错误:
F:\谭飞\VC_MyPro\C++\TempDemo\Main.cpp(75) : error C2440: 'initializing' : cannot convert from '' to 'double (__cdecl *)(const int &)'
None of the functions with this name in scope match the target type
Error executing cl.exe.
TempDemo.exe - 1 error(s), 0 warning(s)