c++ - Using decltype with member function pointers -


i have trouble using decltype member function pointers:

#include <iostream> #include <type_traits>  struct {     void func1() {}     typedef decltype(&a::func1) type; };  int wmain(int argc, wchar_t* argv[]) {     typedef decltype(&a::func1) type;      //case 1     std::wcout         << std::boolalpha         << std::is_member_function_pointer<type>::value         << std::endl;      //case 2     std::wcout         << std::boolalpha         << std::is_member_function_pointer<a::type>::value         << std::endl;      system("pause");     return 0; } 

case 1 prints true expected, case 2 prints false.

is decltype stripping away "member" property of type? if so, why?

also, there way prevent behavior? need type of member function regardless of use decltype.

please help.

edit:

reported microsoft

for sake of formality (having answer question), appears bug in vc2010's compiler. file bug report microsoft can fix in next version.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -