forked from boostorg/type_traits
Fix behaviour of references and arrays in has_trivial_move_assign.
This commit is contained in:
@ -45,6 +45,13 @@ template <> struct has_trivial_move_assign<void const> : public false_type{};
|
||||
template <> struct has_trivial_move_assign<void const volatile> : public false_type{};
|
||||
template <> struct has_trivial_move_assign<void volatile> : public false_type{};
|
||||
#endif
|
||||
template <class T> struct has_trivial_move_assign<T&> : public false_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct has_trivial_move_assign<T&&> : public false_type{};
|
||||
#endif
|
||||
// Array types are not assignable:
|
||||
template <class T, std::size_t N> struct has_trivial_move_assign<T[N]> : public false_type{};
|
||||
template <class T> struct has_trivial_move_assign<T[]> : public false_type{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
@ -213,9 +213,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int&>::value, false)
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int&&>::value, false);
|
||||
#endif
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<const int&>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[3][2]>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[2][4][5][6][3]>::value, true);
|
||||
// array types are not assignable:
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[3][2]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[2][4][5][6][3]>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<UDT>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<empty_UDT>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<void>::value, false);
|
||||
|
Reference in New Issue
Block a user