template<class T>
std::vector<T> convert(int argument)
{
}
int main()
{
decltype(&convert<int>);
return 0;
}
以下给出了 Visual Studio 2010 的此错误:
error C3555: incorrect argument to 'decltype'
为什么?
我正在尝试创建一个 std::map ,其中键是枚举,值是函数。
template<class T>
std::vector<T> convert(int argument)
{
}
int main()
{
decltype(&convert<int>);
return 0;
}
以下给出了 Visual Studio 2010 的此错误:
error C3555: incorrect argument to 'decltype'
为什么?
我正在尝试创建一个 std::map ,其中键是枚举,值是函数。
VS2010 错误。该链接也有一个解决方法:
template <typename T> T identity(T);
decltype(identity(&convert<int>));