1
0
forked from boostorg/core

Fix type_name<> for cv-qualified member pointers without variadic templates. Refs #145.

This commit is contained in:
Peter Dimov
2023-05-21 05:33:21 +03:00
parent c91f8fabff
commit 5eb54d1d36
2 changed files with 15 additions and 2 deletions

View File

@ -862,6 +862,8 @@ template<class T, std::size_t N> struct tn_holder<T const volatile[N]>
// pointers to members
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<class R, class T> struct tn_holder<R T::*>
{
static std::string type_name( std::string const& suffix )
@ -870,7 +872,7 @@ template<class R, class T> struct tn_holder<R T::*>
}
};
#if defined(BOOST_MSVC) && BOOST_MSVC < 1900 && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#if defined(BOOST_MSVC) && BOOST_MSVC < 1900
template<class R, class T, class... A> struct tn_holder<R(T::*)(A...)>
{
@ -904,7 +906,9 @@ template<class R, class T, class... A> struct tn_holder<R(T::*)(A...) const vola
}
};
#endif
#endif // #if defined(BOOST_MSVC) && BOOST_MSVC < 1900
#endif // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
// strings

View File

@ -239,9 +239,18 @@ int main()
TEST(B(&)[1][2][3]);
TEST(B const volatile(***)[1][2][3]);
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || !defined(BOOST_MSVC)
TEST(int A::*);
TEST(int const B::*);
#else
boost::core::type_name<int A::*>();
boost::core::type_name<int const B::*>();
#endif
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
TEST(void(A::*)());