forked from boostorg/core
Support pointers to members
This commit is contained in:
@ -350,7 +350,18 @@ template<class R, class... A> std::string function_type_name( tn_identity<R(A...
|
|||||||
|
|
||||||
if( !suffix.empty() )
|
if( !suffix.empty() )
|
||||||
{
|
{
|
||||||
r += '(' + suffix + ')';
|
r += '(';
|
||||||
|
|
||||||
|
if( suffix.front() == ' ' )
|
||||||
|
{
|
||||||
|
r += suffix.substr( 1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
r += suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
r += ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
r += '(' + tn_add_each<A...>() + ')';
|
r += '(' + tn_add_each<A...>() + ')';
|
||||||
@ -580,6 +591,13 @@ template<class T, std::size_t N> std::string type_name( tn_identity<T const vola
|
|||||||
return array_type_name( tn_identity<T const volatile[N]>(), suffix );
|
return array_type_name( tn_identity<T const volatile[N]>(), suffix );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pointers to members
|
||||||
|
|
||||||
|
template<class R, class T> std::string type_name( tn_identity<R T::*>, std::string const& suffix )
|
||||||
|
{
|
||||||
|
return type_name( tn_identity<R>(), ' ' + type_name( tn_identity<T>(), "" ) + "::*" + suffix );
|
||||||
|
}
|
||||||
|
|
||||||
// nullptr_t
|
// nullptr_t
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_NULLPTR)
|
#if !defined(BOOST_NO_CXX11_NULLPTR)
|
||||||
|
@ -192,6 +192,28 @@ int main()
|
|||||||
TEST(B(&)[1][2][3]);
|
TEST(B(&)[1][2][3]);
|
||||||
TEST(B const volatile(***)[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)
|
#if !defined(BOOST_NO_CXX11_NULLPTR)
|
||||||
|
|
||||||
TEST(std::nullptr_t);
|
TEST(std::nullptr_t);
|
||||||
|
Reference in New Issue
Block a user