]> git.lyx.org Git - lyx.git/blob - 3rdparty/boost/boost/type_traits/has_trivial_move_constructor.hpp
Update to boost 1.72
[lyx.git] / 3rdparty / boost / boost / type_traits / has_trivial_move_constructor.hpp
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_CONSTRUCTOR_HPP_INCLUDED
12 #define BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_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 #ifdef BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR
19
20 #if defined(BOOST_MSVC) || defined(BOOST_INTEL)
21 #include <boost/type_traits/is_pod.hpp>
22 #include <boost/type_traits/is_volatile.hpp>
23 #include <boost/type_traits/is_reference.hpp>
24 #endif
25
26 #if defined(__GNUC__) || defined(__clang__)
27 #include <boost/type_traits/is_constructible.hpp>
28 #include <boost/type_traits/is_volatile.hpp>
29 #endif
30
31
32 namespace boost {
33
34 template <typename T> struct has_trivial_move_constructor : public integral_constant<bool, BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)>{};
35
36 #else
37
38 #ifdef __SUNPRO_CC
39 #include <boost/type_traits/is_constructible.hpp>
40 #include <boost/type_traits/remove_const.hpp>
41 #if __cplusplus >= 201103
42 #define SOLARIS_EXTRA_CHECK && is_constructible<typename remove_const<T>::type, typename remove_const<T>::type&&>::value
43 #endif
44 #endif
45
46 #ifndef SOLARIS_EXTRA_CHECK
47 #define SOLARIS_EXTRA_CHECK
48 #endif
49
50 #include <boost/type_traits/is_pod.hpp>
51 #include <boost/type_traits/is_volatile.hpp>
52
53 namespace boost {
54
55 template <typename T> struct has_trivial_move_constructor 
56    : public integral_constant<bool, ::boost::is_pod<T>::value && !::boost::is_volatile<T>::value SOLARIS_EXTRA_CHECK>{};
57
58 #undef SOLARIS_EXTRA_CHECK
59
60 #endif
61
62 template <> struct has_trivial_move_constructor<void> : public false_type{};
63 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
64 template <> struct has_trivial_move_constructor<void const> : public false_type{};
65 template <> struct has_trivial_move_constructor<void volatile> : public false_type{};
66 template <> struct has_trivial_move_constructor<void const volatile> : public false_type{};
67 #endif
68 // What should we do with reference types??? The standard seems to suggest these are trivial, even if the thing they reference is not:
69 template <class T> struct has_trivial_move_constructor<T&> : public true_type{};
70 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
71 template <class T> struct has_trivial_move_constructor<T&&> : public true_type{};
72 #endif
73 // Arrays can not be explicitly copied:
74 template <class T, std::size_t N> struct has_trivial_move_constructor<T[N]> : public false_type{};
75 template <class T> struct has_trivial_move_constructor<T[]> : public false_type{};
76
77 } // namespace boost
78
79 #endif // BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED