forked from boostorg/type_traits
Fixes for older GCC versions, see issue 11904.
This commit is contained in:
@ -12,6 +12,10 @@
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
|
||||
#include <boost/type_traits/is_abstract.hpp>
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500)
|
||||
|
||||
#include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
@ -28,10 +32,25 @@ namespace boost{
|
||||
template<typename>
|
||||
static boost::type_traits::no_type test(...);
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
|
||||
template<class T, bool b>
|
||||
struct is_default_constructible_abstract_filter
|
||||
{
|
||||
static const bool value = sizeof(is_default_constructible_imp::test<T>(0)) == sizeof(boost::type_traits::yes_type);
|
||||
};
|
||||
template<class T>
|
||||
struct is_default_constructible_abstract_filter<T, true>
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
|
||||
template <class T> struct is_default_constructible : public integral_constant<bool, detail::is_default_constructible_abstract_filter<T, boost::is_abstract<T>::value>::value>{};
|
||||
#else
|
||||
template <class T> struct is_default_constructible : public integral_constant<bool, sizeof(detail::is_default_constructible_imp::test<T>(0)) == sizeof(boost::type_traits::yes_type)>{};
|
||||
#endif
|
||||
template <class T, std::size_t N> struct is_default_constructible<T[N]> : public is_default_constructible<T>{};
|
||||
template <class T> struct is_default_constructible<T[]> : public is_default_constructible<T>{};
|
||||
template <class T> struct is_default_constructible<T&> : public integral_constant<bool, false>{};
|
||||
|
@ -33,7 +33,7 @@ template <class T> struct is_nothrow_move_assignable<T&> : public false_type{};
|
||||
template <class T> struct is_nothrow_move_assignable<T&&> : public false_type{};
|
||||
#endif
|
||||
|
||||
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
|
||||
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
|
||||
|
||||
namespace detail{
|
||||
|
||||
|
@ -26,7 +26,7 @@ struct is_nothrow_move_constructible : public integral_constant<bool, BOOST_IS_N
|
||||
template <class T> struct is_nothrow_move_constructible<volatile T> : public ::boost::false_type {};
|
||||
template <class T> struct is_nothrow_move_constructible<const volatile T> : public ::boost::false_type{};
|
||||
|
||||
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
|
||||
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40800)
|
||||
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
@ -198,7 +198,9 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<bug11324_derived>::
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<deleted_default_construct>::value, false);
|
||||
#endif
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<private_default_construct>::value, false);
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
Reference in New Issue
Block a user