mirror of
https://github.com/boostorg/core.git
synced 2025-07-29 20:37:22 +02:00
Apply msvc-12.0 (and below) workarounds
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/core/demangle.hpp>
|
||||
#include <boost/core/is_same.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
@ -73,6 +74,24 @@ template<class T> struct tn_is_reference<T&&>
|
||||
|
||||
#endif
|
||||
|
||||
// tn_remove_const
|
||||
|
||||
template<class T> struct tn_remove_const
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T> struct tn_remove_const<T const>
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
// tn_is_function (also catches references but that's OK)
|
||||
|
||||
template<class T, class U = typename tn_remove_const<T>::type> struct tn_is_function: core::is_same<U, U const>
|
||||
{
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_TYPEID)
|
||||
|
||||
// typeid_name
|
||||
@ -261,21 +280,21 @@ template<class T> std::string type_name( tn_identity<T const volatile> )
|
||||
#else
|
||||
|
||||
template<class T>
|
||||
typename tn_enable_if<!tn_is_reference<T>::value, std::string>::type
|
||||
typename tn_enable_if<!tn_is_function<T>::value, std::string>::type
|
||||
type_name( tn_identity<T const> )
|
||||
{
|
||||
return type_name( tn_identity<T>() ) + " const";
|
||||
}
|
||||
|
||||
template<class T>
|
||||
typename tn_enable_if<!tn_is_reference<T>::value, std::string>::type
|
||||
typename tn_enable_if<!tn_is_function<T>::value, std::string>::type
|
||||
type_name( tn_identity<T volatile> )
|
||||
{
|
||||
return type_name( tn_identity<T>() ) + " volatile";
|
||||
}
|
||||
|
||||
template<class T>
|
||||
typename tn_enable_if<!tn_is_reference<T>::value, std::string>::type
|
||||
typename tn_enable_if<!tn_is_function<T>::value, std::string>::type
|
||||
type_name( tn_identity<T const volatile> )
|
||||
{
|
||||
return type_name( tn_identity<T>() ) + " const volatile";
|
||||
|
@ -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[]);
|
||||
|
Reference in New Issue
Block a user