Add msvc workarounds

This commit is contained in:
Peter Dimov
2021-10-05 08:04:01 +03:00
parent 4f6f7c3799
commit bb0c6381f6
2 changed files with 36 additions and 1 deletions

View File

@ -396,6 +396,8 @@ template<class R, class... A> std::string type_name( tn_identity<R(A...)>, std::
return function_type_name( tn_identity<R(A...)>(), "", suffix );
}
#if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
template<class R, class... A> std::string type_name( tn_identity<R(A...) const>, std::string const& suffix )
{
return function_type_name( tn_identity<R(A...)>(), " const", suffix );
@ -411,6 +413,8 @@ template<class R, class... A> std::string type_name( tn_identity<R(A...) const v
return function_type_name( tn_identity<R(A...)>(), " const volatile", suffix );
}
#endif
#if !defined(BOOST_NO_CXX11_REF_QUALIFIERS)
template<class R, class... A> std::string type_name( tn_identity<R(A...) &>, std::string const& suffix )
@ -619,6 +623,25 @@ template<class R, class T> std::string type_name( tn_identity<R T::*>, std::stri
return type_name( tn_identity<R>(), ' ' + type_name( tn_identity<T>(), "" ) + "::*" + suffix );
}
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1900 && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<class R, class T, class... A> std::string type_name( tn_identity<R(T::*)(A...) const>, std::string const& suffix )
{
return function_type_name( tn_identity<R(A...)>(), " const", ' ' + type_name( tn_identity<T>(), "" ) + "::*" + suffix );
}
template<class R, class T, class... A> std::string type_name( tn_identity<R(T::*)(A...) volatile>, std::string const& suffix )
{
return function_type_name( tn_identity<R(A...)>(), " volatile", ' ' + type_name( tn_identity<T>(), "" ) + "::*" + suffix );
}
template<class R, class T, class... A> std::string type_name( tn_identity<R(T::*)(A...) const volatile>, std::string const& suffix )
{
return function_type_name( tn_identity<R(A...)>(), " const volatile", ' ' + type_name( tn_identity<T>(), "" ) + "::*" + suffix );
}
#endif
// nullptr_t
#if !defined(BOOST_NO_CXX11_NULLPTR)

View File

@ -155,10 +155,14 @@ int main()
#endif
#if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
TEST(void() const);
TEST(void() volatile);
TEST(void() const volatile);
#endif
#if !defined(BOOST_NO_CXX11_REF_QUALIFIERS)
TEST(void() &);
@ -192,14 +196,16 @@ int main()
#endif
#endif
#endif // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
TEST(A[]);
TEST(A const[]);
TEST(A volatile[]);
TEST(A const volatile[]);
#if !defined(BOOST_MSVC) || BOOST_MSVC >= 1500
TEST(A(&)[]);
#endif
TEST(A const(***)[]);
TEST(B[1]);
@ -213,7 +219,9 @@ int main()
TEST(A[][2][3]);
TEST(A const[][2][3]);
#if !defined(BOOST_MSVC) || BOOST_MSVC >= 1500
TEST(A(&)[][2][3]);
#endif
TEST(A const(***)[][2][3]);
TEST(B[1][2][3]);
@ -225,11 +233,15 @@ int main()
TEST(int A::*);
TEST(int const B::*);
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
TEST(void(A::*)());
TEST(void(A::*)() const);
TEST(void(A::*)() volatile);
TEST(void(A::*)() const volatile);
#endif
#if !defined(BOOST_NO_CXX11_REF_QUALIFIERS)
TEST(void(A::*)() &);