2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
3 // (C) Copyright Eric Friedman 2002-2003.
4 // (C) Copyright Antony Polukhin 2013.
5 // Use, modification and distribution are subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt).
9 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
11 #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
12 #define BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
14 #include <cstddef> // size_t
15 #include <boost/type_traits/intrinsics.hpp>
16 #include <boost/type_traits/integral_constant.hpp>
18 #if !defined(BOOST_HAS_TRIVIAL_MOVE_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL)
19 #include <boost/type_traits/is_pod.hpp>
20 #include <boost/type_traits/is_const.hpp>
21 #include <boost/type_traits/is_volatile.hpp>
23 #include <boost/type_traits/is_reference.hpp>
27 #if defined(__GNUC__) || defined(__clang)
28 #include <boost/type_traits/is_assignable.hpp>
29 #include <boost/type_traits/is_volatile.hpp>
33 #include <boost/type_traits/is_assignable.hpp>
34 #include <boost/type_traits/remove_const.hpp>
35 #if __cplusplus >= 201103
36 #define SOLARIS_EXTRA_CHECK && is_assignable<typename remove_const<T>::type&, typename remove_const<T>::type&&>::value
40 #ifndef SOLARIS_EXTRA_CHECK
41 #define SOLARIS_EXTRA_CHECK
47 struct has_trivial_move_assign : public integral_constant<bool,
48 #ifdef BOOST_HAS_TRIVIAL_MOVE_ASSIGN
49 BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)
51 ::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::value SOLARIS_EXTRA_CHECK
55 template <> struct has_trivial_move_assign<void> : public false_type{};
56 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
57 template <> struct has_trivial_move_assign<void const> : public false_type{};
58 template <> struct has_trivial_move_assign<void const volatile> : public false_type{};
59 template <> struct has_trivial_move_assign<void volatile> : public false_type{};
61 template <class T> struct has_trivial_move_assign<T&> : public false_type{};
62 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
63 template <class T> struct has_trivial_move_assign<T&&> : public false_type{};
65 // Array types are not assignable:
66 template <class T, std::size_t N> struct has_trivial_move_assign<T[N]> : public false_type{};
67 template <class T> struct has_trivial_move_assign<T[]> : public false_type{};
71 #undef SOLARIS_EXTRA_CHECK
73 #endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED