
15 Jan
2015
15 Jan
'15
6:04 p.m.
Although, now that I think of it, creating 'void() const' is in principle possible in C++03 as well. Not sure what the old type traits did with such types.
boost::is_function<void() const> says 0, even in C++11 mode. #include <boost/type_traits/is_function.hpp> #include <boost/core/demangle.hpp> #include <iostream> #include <typeinfo> struct X { void f() const {} }; template< class T > struct Y { }; template< class C, class F > void test( F C::* /*pf*/ ) { std::cout << boost::core::demangle( typeid( F ).name() ) << std::endl; std::cout << boost::core::demangle( typeid( Y<F> ).name() ) << std::endl; std::cout << boost::is_function< F >::value << std::endl; } int main() { test( &X::f ); }