From b93317815c7b62551e34e13253008d2d56817148 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 5 Oct 2021 05:30:37 +0300 Subject: [PATCH] Apply msvc-12.0 (and below) workarounds --- include/boost/core/type_name.hpp | 25 ++++++++++++++++++++++--- test/type_name_test.cpp | 3 +++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/include/boost/core/type_name.hpp b/include/boost/core/type_name.hpp index 33e717f..dfdedd3 100644 --- a/include/boost/core/type_name.hpp +++ b/include/boost/core/type_name.hpp @@ -14,6 +14,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include +#include #include #include #include @@ -73,6 +74,24 @@ template struct tn_is_reference #endif +// tn_remove_const + +template struct tn_remove_const +{ + typedef T type; +}; + +template struct tn_remove_const +{ + typedef T type; +}; + +// tn_is_function (also catches references but that's OK) + +template::type> struct tn_is_function: core::is_same +{ +}; + #if !defined(BOOST_NO_TYPEID) // typeid_name @@ -261,21 +280,21 @@ template std::string type_name( tn_identity ) #else template -typename tn_enable_if::value, std::string>::type +typename tn_enable_if::value, std::string>::type type_name( tn_identity ) { return type_name( tn_identity() ) + " const"; } template -typename tn_enable_if::value, std::string>::type +typename tn_enable_if::value, std::string>::type type_name( tn_identity ) { return type_name( tn_identity() ) + " volatile"; } template -typename tn_enable_if::value, std::string>::type +typename tn_enable_if::value, std::string>::type type_name( tn_identity ) { return type_name( tn_identity() ) + " const volatile"; diff --git a/test/type_name_test.cpp b/test/type_name_test.cpp index 52a74a5..b3439c1 100644 --- a/test/type_name_test.cpp +++ b/test/type_name_test.cpp @@ -105,6 +105,8 @@ int main() TEST(void*); TEST(void const* volatile*); +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + TEST(void()); TEST(int(float, A, B*)); @@ -115,6 +117,7 @@ int main() TEST(void(&&)()); +#endif #endif TEST(A[]);