1
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).
8//
9// See http://www.boost.org/libs/type_traits for most recent version including documentation.
10
11#ifndef BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
12#define BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
13
14#include <cstddef> // size_t
15#include <boost/type_traits/intrinsics.hpp>
16#include <boost/type_traits/integral_constant.hpp>
17
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>
22#ifdef BOOST_MSVC
23#include <boost/type_traits/is_reference.hpp>
24#endif
25#endif
26
27#if defined(__GNUC__) || defined(__clang)
28#include <boost/type_traits/is_assignable.hpp>
29#include <boost/type_traits/is_volatile.hpp>
30#endif
31
32#ifdef __SUNPRO_CC
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
37#endif
38#endif
39
40#ifndef SOLARIS_EXTRA_CHECK
41#define SOLARIS_EXTRA_CHECK
42#endif
43
44namespace boost{
45
46template <typename T>
47struct has_trivial_move_assign : public integral_constant<bool,
48#ifdef BOOST_HAS_TRIVIAL_MOVE_ASSIGN
49 BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)
50#else
51 ::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::value SOLARIS_EXTRA_CHECK
52#endif
53 > {};
54
55template <> struct has_trivial_move_assign<void> : public false_type{};
56#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
57template <> struct has_trivial_move_assign<void const> : public false_type{};
58template <> struct has_trivial_move_assign<void const volatile> : public false_type{};
59template <> struct has_trivial_move_assign<void volatile> : public false_type{};
60#endif
61template <class T> struct has_trivial_move_assign<T&> : public false_type{};
62#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
63template <class T> struct has_trivial_move_assign<T&&> : public false_type{};
64#endif
65// Array types are not assignable:
66template <class T, std::size_t N> struct has_trivial_move_assign<T[N]> : public false_type{};
67template <class T> struct has_trivial_move_assign<T[]> : public false_type{};
68
69} // namespace boost
70
71#undef SOLARIS_EXTRA_CHECK
72
73#endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
74