comparison DEPENDENCIES/generic/include/boost/move/detail/move_helpers.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
10 ////////////////////////////////////////////////////////////////////////////// 10 //////////////////////////////////////////////////////////////////////////////
11 11
12 #ifndef BOOST_MOVE_MOVE_HELPERS_HPP 12 #ifndef BOOST_MOVE_MOVE_HELPERS_HPP
13 #define BOOST_MOVE_MOVE_HELPERS_HPP 13 #define BOOST_MOVE_MOVE_HELPERS_HPP
14 14
15 #include <boost/move/utility.hpp> 15 #ifndef BOOST_CONFIG_HPP
16 #include <boost/type_traits/is_class.hpp> 16 # include <boost/config.hpp>
17 #include <boost/move/utility.hpp>
18 #include <boost/move/traits.hpp>
19
20 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || (defined(_MSC_VER) && (_MSC_VER == 1600))
21 #include <boost/type_traits/is_same.hpp>
22 #include <boost/type_traits/is_class.hpp>
23 #include <boost/type_traits/is_convertible.hpp>
24 #include <boost/utility/enable_if.hpp>
25 #endif 17 #endif
26 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) 18 #
27 #include <boost/mpl/if.hpp> 19 #if defined(BOOST_HAS_PRAGMA_ONCE)
20 # pragma once
28 #endif 21 #endif
29 22
23 #include <boost/move/utility_core.hpp>
24 #include <boost/move/detail/meta_utils.hpp>
30 25
31 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) 26 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
32 struct not_a_type; 27
33 struct not_a_type2;
34 #define BOOST_MOVE_CATCH_CONST(U) \ 28 #define BOOST_MOVE_CATCH_CONST(U) \
35 typename ::boost::mpl::if_< ::boost::is_class<U>, BOOST_CATCH_CONST_RLVALUE(U), const U &>::type 29 typename ::boost::move_detail::if_< ::boost::move_detail::is_class_or_union<U>, BOOST_CATCH_CONST_RLVALUE(U), const U &>::type
36 #define BOOST_MOVE_CATCH_RVALUE(U)\ 30 #define BOOST_MOVE_CATCH_RVALUE(U)\
37 typename ::boost::mpl::if_< ::boost::is_class<U>, BOOST_RV_REF(U), not_a_type>::type 31 typename ::boost::move_detail::if_< ::boost::move_detail::is_class_or_union<U>, BOOST_RV_REF(U), ::boost::move_detail::nat>::type
38 #define BOOST_MOVE_CATCH_FWD(U) BOOST_FWD_REF(U) 32 #define BOOST_MOVE_CATCH_FWD(U) BOOST_FWD_REF(U)
39 #else 33 #else
40 #define BOOST_MOVE_CATCH_CONST(U) const U & 34 #define BOOST_MOVE_CATCH_CONST(U) const U &
41 #define BOOST_MOVE_CATCH_RVALUE(U) U && 35 #define BOOST_MOVE_CATCH_RVALUE(U) U &&
42 #define BOOST_MOVE_CATCH_FWD(U) U && 36 #define BOOST_MOVE_CATCH_FWD(U) U &&
52 \ 46 \
53 RETURN_VALUE PUB_FUNCTION(TYPE &x)\ 47 RETURN_VALUE PUB_FUNCTION(TYPE &x)\
54 { return FWD_FUNCTION(const_cast<const TYPE &>(x)); }\ 48 { return FWD_FUNCTION(const_cast<const TYPE &>(x)); }\
55 \ 49 \
56 template<class BOOST_MOVE_TEMPL_PARAM>\ 50 template<class BOOST_MOVE_TEMPL_PARAM>\
57 typename ::boost::enable_if_c\ 51 typename ::boost::move_detail::enable_if_c\
58 < ::boost::is_class<TYPE>::value &&\ 52 < ::boost::move_detail::is_class_or_union<TYPE>::value &&\
59 ::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value &&\ 53 ::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value &&\
60 !::boost::has_move_emulation_enabled<BOOST_MOVE_TEMPL_PARAM>::value\ 54 !::boost::has_move_emulation_enabled<BOOST_MOVE_TEMPL_PARAM>::value\
61 , RETURN_VALUE >::type\ 55 , RETURN_VALUE >::type\
62 PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\ 56 PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\
63 { return FWD_FUNCTION(u); }\ 57 { return FWD_FUNCTION(u); }\
64 \ 58 \
65 template<class BOOST_MOVE_TEMPL_PARAM>\ 59 template<class BOOST_MOVE_TEMPL_PARAM>\
66 typename ::boost::enable_if_c\ 60 typename ::boost::move_detail::enable_if_c\
67 < (!::boost::is_class<BOOST_MOVE_TEMPL_PARAM>::value || \ 61 < (!::boost::move_detail::is_class_or_union<BOOST_MOVE_TEMPL_PARAM>::value || \
68 !::boost::move_detail::is_rv<BOOST_MOVE_TEMPL_PARAM>::value) && \ 62 !::boost::move_detail::is_rv<BOOST_MOVE_TEMPL_PARAM>::value) && \
69 !::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value \ 63 !::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value \
70 , RETURN_VALUE >::type\ 64 , RETURN_VALUE >::type\
71 PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\ 65 PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\
72 {\ 66 {\
73 TYPE t(u);\ 67 TYPE t(u);\
74 return FWD_FUNCTION(::boost::move(t));\ 68 return FWD_FUNCTION(::boost::move(t));\
75 }\ 69 }\
76 // 70 //
77 // ::boost::is_convertible<BOOST_MOVE_TEMPL_PARAM, TYPE>::value && 71
78 #elif (defined(_MSC_VER) && (_MSC_VER == 1600)) 72 #elif (defined(_MSC_VER) && (_MSC_VER == 1600))
79 73
80 #define BOOST_MOVE_CONVERSION_AWARE_CATCH(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION)\ 74 #define BOOST_MOVE_CONVERSION_AWARE_CATCH(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION)\
81 RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_CONST(TYPE) x)\ 75 RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_CONST(TYPE) x)\
82 { return FWD_FUNCTION(static_cast<const TYPE&>(x)); }\ 76 { return FWD_FUNCTION(static_cast<const TYPE&>(x)); }\
83 \ 77 \
84 RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_RVALUE(TYPE) x) \ 78 RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_RVALUE(TYPE) x) \
85 { return FWD_FUNCTION(::boost::move(x)); }\ 79 { return FWD_FUNCTION(::boost::move(x)); }\
86 \ 80 \
87 template<class BOOST_MOVE_TEMPL_PARAM>\ 81 template<class BOOST_MOVE_TEMPL_PARAM>\
88 typename ::boost::enable_if_c\ 82 typename ::boost::move_detail::enable_if_c\
89 < !::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value\ 83 < !::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value\
90 , RETURN_VALUE >::type\ 84 , RETURN_VALUE >::type\
91 PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\ 85 PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\
92 {\ 86 {\
93 TYPE t(u);\ 87 TYPE t(u);\
94 return FWD_FUNCTION(::boost::move(t));\ 88 return FWD_FUNCTION(::boost::move(t));\
119 \ 113 \
120 RETURN_VALUE PUB_FUNCTION(ARG1 arg1, TYPE &x)\ 114 RETURN_VALUE PUB_FUNCTION(ARG1 arg1, TYPE &x)\
121 { return FWD_FUNCTION(arg1, const_cast<const TYPE &>(x)); }\ 115 { return FWD_FUNCTION(arg1, const_cast<const TYPE &>(x)); }\
122 \ 116 \
123 template<class BOOST_MOVE_TEMPL_PARAM>\ 117 template<class BOOST_MOVE_TEMPL_PARAM>\
124 typename ::boost::enable_if_c<\ 118 typename ::boost::move_detail::enable_if_c<\
125 ::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value &&\ 119 ::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value &&\
126 !::boost::has_move_emulation_enabled<BOOST_MOVE_TEMPL_PARAM>::value\ 120 !::boost::has_move_emulation_enabled<BOOST_MOVE_TEMPL_PARAM>::value\
127 , RETURN_VALUE >::type\ 121 , RETURN_VALUE >::type\
128 PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\ 122 PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\
129 { return FWD_FUNCTION(arg1, u); }\ 123 { return FWD_FUNCTION(arg1, u); }\
130 \ 124 \
131 template<class BOOST_MOVE_TEMPL_PARAM>\ 125 template<class BOOST_MOVE_TEMPL_PARAM>\
132 typename ::boost::enable_if_c<\ 126 typename ::boost::move_detail::enable_if_c<\
133 !::boost::move_detail::is_rv<BOOST_MOVE_TEMPL_PARAM>::value && \ 127 !::boost::move_detail::is_rv<BOOST_MOVE_TEMPL_PARAM>::value && \
134 !::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value && \ 128 !::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value && \
135 !::boost::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO>::value \ 129 !::boost::move_detail::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO>::value \
136 , RETURN_VALUE >::type\ 130 , RETURN_VALUE >::type\
137 PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\ 131 PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\
138 {\ 132 {\
139 TYPE t(u);\ 133 TYPE t(u);\
140 return FWD_FUNCTION(arg1, ::boost::move(t));\ 134 return FWD_FUNCTION(arg1, ::boost::move(t));\
149 \ 143 \
150 RETURN_VALUE PUB_FUNCTION(ARG1 arg1, BOOST_MOVE_CATCH_RVALUE(TYPE) x) \ 144 RETURN_VALUE PUB_FUNCTION(ARG1 arg1, BOOST_MOVE_CATCH_RVALUE(TYPE) x) \
151 { return FWD_FUNCTION(arg1, ::boost::move(x)); }\ 145 { return FWD_FUNCTION(arg1, ::boost::move(x)); }\
152 \ 146 \
153 template<class BOOST_MOVE_TEMPL_PARAM>\ 147 template<class BOOST_MOVE_TEMPL_PARAM>\
154 typename ::boost::enable_if_c\ 148 typename ::boost::move_detail::enable_if_c\
155 < !::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value && \ 149 < !::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value && \
156 !::boost::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO>::value \ 150 !::boost::move_detail::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO>::value \
157 , RETURN_VALUE >::type\ 151 , RETURN_VALUE >::type\
158 PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\ 152 PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\
159 {\ 153 {\
160 TYPE t(u);\ 154 TYPE t(u);\
161 return FWD_FUNCTION(arg1, ::boost::move(t));\ 155 return FWD_FUNCTION(arg1, ::boost::move(t));\