mirror of
https://github.com/boostorg/core.git
synced 2025-07-30 04:47:24 +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
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/core/demangle.hpp>
|
#include <boost/core/demangle.hpp>
|
||||||
|
#include <boost/core/is_same.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -73,6 +74,24 @@ template<class T> struct tn_is_reference<T&&>
|
|||||||
|
|
||||||
#endif
|
#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)
|
#if !defined(BOOST_NO_TYPEID)
|
||||||
|
|
||||||
// typeid_name
|
// typeid_name
|
||||||
@ -261,21 +280,21 @@ template<class T> std::string type_name( tn_identity<T const volatile> )
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
template<class T>
|
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> )
|
type_name( tn_identity<T const> )
|
||||||
{
|
{
|
||||||
return type_name( tn_identity<T>() ) + " const";
|
return type_name( tn_identity<T>() ) + " const";
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
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> )
|
type_name( tn_identity<T volatile> )
|
||||||
{
|
{
|
||||||
return type_name( tn_identity<T>() ) + " volatile";
|
return type_name( tn_identity<T>() ) + " volatile";
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
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> )
|
type_name( tn_identity<T const volatile> )
|
||||||
{
|
{
|
||||||
return 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*);
|
||||||
TEST(void const* volatile*);
|
TEST(void const* volatile*);
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
TEST(void());
|
TEST(void());
|
||||||
TEST(int(float, A, B*));
|
TEST(int(float, A, B*));
|
||||||
|
|
||||||
@ -115,6 +117,7 @@ int main()
|
|||||||
|
|
||||||
TEST(void(&&)());
|
TEST(void(&&)());
|
||||||
|
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TEST(A[]);
|
TEST(A[]);
|
||||||
|
Reference in New Issue
Block a user