1
0
forked from boostorg/move

Some workarounds for older compilers to see if #36 is fixed.

This commit is contained in:
Ion Gaztañaga
2020-12-31 17:13:42 +01:00
parent 262b701162
commit 199195ee1b

View File

@@ -112,9 +112,9 @@
#if defined(BOOST_CLANG)
// BOOST_MOVE_HAS_TRAIT
# ifdef __is_identifier
# if defined __is_identifier
# define BOOST_MOVE_HAS_TRAIT(T) (__has_extension(T) || !__is_identifier(__##T))
# elif __has_extension
# elif defined(__has_extension)
# define BOOST_MOVE_HAS_TRAIT(T) __has_extension(T)
# else
# define BOOST_MOVE_HAS_TRAIT(T) 0
@@ -197,7 +197,7 @@
# endif
// BOOST_MOVE_HAS_TRIVIAL_MOVE_ASSIGN
# if BOOST_MOVE_HAS_TRAIT(is_assignable) && BOOST_MOVE_HAS_TRAIT(is_trivially_assignable)
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && BOOST_MOVE_HAS_TRAIT(is_assignable) && BOOST_MOVE_HAS_TRAIT(is_trivially_assignable)
# define BOOST_MOVE_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_assignable(T, T&&) && __is_trivially_assignable(T, T&&))
# elif BOOST_MOVE_HAS_TRAIT(has_trivial_move_assign)
# define BOOST_MOVE_HAS_TRIVIAL_MOVE_ASSIGN(T) __has_trivial_move_assign(T)
@@ -211,7 +211,7 @@
# endif
// BOOST_MOVE_HAS_NOTHROW_MOVE_ASSIGN
# if BOOST_MOVE_HAS_TRAIT(is_assignable) && BOOST_MOVE_HAS_TRAIT(is_nothrow_assignable)
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && BOOST_MOVE_HAS_TRAIT(is_assignable) && BOOST_MOVE_HAS_TRAIT(is_nothrow_assignable)
# define BOOST_MOVE_HAS_NOTHROW_MOVE_ASSIGN(T) (__is_assignable(T, T&&) && __is_nothrow_assignable(T, T&&))
# elif BOOST_MOVE_HAS_TRAIT(has_nothrow_move_assign)
# define BOOST_MOVE_HAS_NOTHROW_MOVE_ASSIGN(T) __has_nothrow_move_assign(T)
@@ -248,7 +248,7 @@
# define BOOST_MOVE_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_MOVE_INTEL_TT_OPTS))
# define BOOST_MOVE_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_MOVE_INTEL_TT_OPTS))
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_SFINAE_EXPR)
template <typename T>
T && boost_move_tt_declval() BOOST_NOEXCEPT;
@@ -303,7 +303,11 @@
template <typename T, typename U>
struct boost_move_tt_is_nothrow_assignable<T, U, true>
{
#if !defined(BOOST_NO_CXX11_NOEXCEPT)
static const bool value = noexcept(boost_move_tt_declval<T>() = boost_move_tt_declval<U>());
#else
static const bool value = false;
#endif
};
template <typename T, typename U, bool = BOOST_MOVE_IS_CONSTRUCTIBLE(T, U)>
@@ -315,7 +319,11 @@
template <typename T, typename U>
struct boost_move_tt_is_nothrow_constructible<T, U, true>
{
#if !defined(BOOST_NO_CXX11_NOEXCEPT)
static const bool value = noexcept(T(boost_move_tt_declval<U>()));
#else
static const bool value = false;
#endif
};
# define BOOST_MOVE_HAS_NOTHROW_MOVE_ASSIGN(T) boost_move_tt_is_nothrow_assignable<T, T&&>::value