2

Looking at the GNU g++ 4.8.4 type_traits header code I've found the definition for the std::is_function template. It includes some template specializations such as this:

template<typename _Res, typename... _ArgTypes>
  struct is_function<_Res(_ArgTypes...) const>
   : public true_type { };

Specializations for volatile and const volatile functions are also there.

It is known that only member functions can be declared cv-qualified. So what do these specializations match? Is this a GNU extension?

erdavila
  • 341
  • 2
  • 15
  • 3
    They are essentially "half a type". http://stackoverflow.com/questions/25654186/trait-to-drop-const-from-a-member-function-type/25654229#25654229 – T.C. Oct 17 '15 at 03:04
  • Thanks @T.C. ! Would you like elaborate a answer for this question? – erdavila Oct 18 '15 at 00:38

0 Answers0