diff --git a/include/boost/core/type_name.hpp b/include/boost/core/type_name.hpp index df13e8e..8e332e8 100644 --- a/include/boost/core/type_name.hpp +++ b/include/boost/core/type_name.hpp @@ -350,7 +350,18 @@ template std::string function_type_name( tn_identity() + ')'; @@ -580,6 +591,13 @@ template std::string type_name( tn_identity(), suffix ); } +// pointers to members + +template std::string type_name( tn_identity, std::string const& suffix ) +{ + return type_name( tn_identity(), ' ' + type_name( tn_identity(), "" ) + "::*" + suffix ); +} + // nullptr_t #if !defined(BOOST_NO_CXX11_NULLPTR) diff --git a/test/type_name_test.cpp b/test/type_name_test.cpp index 71a2221..437c0c3 100644 --- a/test/type_name_test.cpp +++ b/test/type_name_test.cpp @@ -192,6 +192,28 @@ int main() TEST(B(&)[1][2][3]); TEST(B const volatile(***)[1][2][3]); + TEST(int A::*); + TEST(int const B::*); + + TEST(void(A::*)()); + TEST(void(A::*)() const); + TEST(void(A::*)() volatile); + TEST(void(A::*)() const volatile); + +#if !defined(BOOST_NO_CXX11_REF_QUALIFIERS) + + TEST(void(A::*)() &); + TEST(void(A::*)() const &&); + +#endif + +#if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED ) + + TEST(void(A::*)() volatile & noexcept); + TEST(void(A::*)() const volatile && noexcept); + +#endif + #if !defined(BOOST_NO_CXX11_NULLPTR) TEST(std::nullptr_t);