Invalid argument 'decltype'

template<class T> std::vector<T> convert(int argument) { } int main() { decltype(&convert<int>); return 0; } 

The following is this error for Visual Studio 2010:

 error C3555: incorrect argument to 'decltype' 

Why?

I am trying to create std :: map where the key is an enumeration and the value is a function.

+4
source share
1 answer

error VS2010 . This link also has a workaround:

 template <typename T> T identity(T); decltype(identity(&convert<int>)); 
+8
source

Source: https://habr.com/ru/post/1433986/


All Articles