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 <boost/type_traits/intrinsics.hpp>
15#include <boost/type_traits/integral_constant.hpp>
16
17#if !defined(BOOST_HAS_TRIVIAL_MOVE_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL)
18#include <boost/type_traits/is_pod.hpp>
19#include <boost/type_traits/is_const.hpp>
20#include <boost/type_traits/is_volatile.hpp>
21#ifdef BOOST_MSVC
22#include <boost/type_traits/is_reference.hpp>
23#endif
24#endif
25
26#if defined(__GNUC__) || defined(__clang)
27#include <boost/type_traits/is_assignable.hpp>
28#include <boost/type_traits/is_volatile.hpp>
29#endif
30
31#ifdef __SUNPRO_CC
32#include <boost/type_traits/is_assignable.hpp>
33#include <boost/type_traits/remove_const.hpp>
34#if __cplusplus >= 201103
35#define SOLARIS_EXTRA_CHECK && is_assignable<typename remove_const<T>::type&, typename remove_const<T>::type&&>::value
36#endif
37#endif
38
39#ifndef SOLARIS_EXTRA_CHECK
40#define SOLARIS_EXTRA_CHECK
41#endif
42
43namespace boost{
44
45template <typename T>
46struct has_trivial_move_assign : public integral_constant<bool,
47#ifdef BOOST_HAS_TRIVIAL_MOVE_ASSIGN
48 BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)
49#else
50 ::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::value SOLARIS_EXTRA_CHECK
51#endif
52 > {};
53
54template <> struct has_trivial_move_assign<void> : public false_type{};
55#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
56template <> struct has_trivial_move_assign<void const> : public false_type{};
57template <> struct has_trivial_move_assign<void const volatile> : public false_type{};
58template <> struct has_trivial_move_assign<void volatile> : public false_type{};
59#endif
60template <class T> struct has_trivial_move_assign<T&> : public false_type{};
61#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
62template <class T> struct has_trivial_move_assign<T&&> : public false_type{};
63#endif
64// Array types are not assignable:
65template <class T, std::size_t N> struct has_trivial_move_assign<T[N]> : public false_type{};
66template <class T> struct has_trivial_move_assign<T[]> : public false_type{};
67
68} // namespace boost
69
70#undef SOLARIS_EXTRA_CHECK
71
72#endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
73