title: Using decltype with member function pointers
body: <p>I have some trouble using <code>decltype</code> for member function pointers:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;type_traits&gt;
  
  struct A
  {
      void func1() {}
      typedef decltype(&amp;A::func1) type;
  };
  
  int wmain(int argc, wchar_t* argv[])
  {
      typedef decltype(&amp;A::func1) type;
  
      //Case 1
      std::wcout
          &lt;&lt; std::boolalpha
          &lt;&lt; std::is_member_function_pointer&lt;type&gt;::value
          &lt;&lt; std::endl;
  
      //Case 2
      std::wcout
          &lt;&lt; std::boolalpha
          &lt;&lt; std::is_member_function_pointer&lt;A::type&gt;::value
          &lt;&lt; std::endl;
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>Case 1 prints <code>true</code> as expected, but Case 2 prints <code>false</code>.</p>
  
  <p>Is <code>decltype</code> stripping away the "member" property of a type? If so, why?</p>
  
  <p>Also, is there a way to prevent this behavior? I need to get the type of a member function regardless of where I use <code>decltype</code>.</p>
  
  <p>Please help.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><a href="https://connect.microsoft.com/VisualStudio/feedback/details/678194/decltype-strips-member-property-from-member-function-pointers" rel="nofollow">Reported to Microsoft</a></p>