Baz*_*Baz 5 c++ visual-studio-2010
template<class T>
std::vector<T> convert(int argument)
{
}
int main()
{
decltype(&convert<int>);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
以下为Visual Studio 2010提供此错误:
error C3555: incorrect argument to 'decltype'
Run Code Online (Sandbox Code Playgroud)
为什么?
我想创建一个std :: map,其中键是一个枚举,值是一个函数.
VS2010的bug.该链接还有一个解决方法:
template <typename T> T identity(T);
decltype(identity(&convert<int>));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
835 次 |
| 最近记录: |