]> git.sesse.net Git - casparcg/blob - dependencies64/boost/boost/move/detail/move_helpers.hpp
Add updates to the basic casparcg.config illustrating the possible options for use...
[casparcg] / dependencies64 / boost / boost / move / detail / move_helpers.hpp
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2010-2012.
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // See http://www.boost.org/libs/move for documentation.
9 //
10 //////////////////////////////////////////////////////////////////////////////
11
12 #ifndef BOOST_MOVE_MOVE_HELPERS_HPP
13 #define BOOST_MOVE_MOVE_HELPERS_HPP
14
15 #ifndef BOOST_CONFIG_HPP
16 #  include <boost/config.hpp>
17 #endif
18 #
19 #if defined(BOOST_HAS_PRAGMA_ONCE)
20 #  pragma once
21 #endif
22
23 #include <boost/move/utility_core.hpp>
24 #include <boost/move/detail/meta_utils.hpp>
25
26 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
27
28 #define BOOST_MOVE_CATCH_CONST(U)  \
29    typename ::boost::move_detail::if_< ::boost::move_detail::is_class_or_union<U>, BOOST_CATCH_CONST_RLVALUE(U), const U &>::type
30 #define BOOST_MOVE_CATCH_RVALUE(U)\
31    typename ::boost::move_detail::if_< ::boost::move_detail::is_class_or_union<U>, BOOST_RV_REF(U), ::boost::move_detail::nat>::type
32 #define BOOST_MOVE_CATCH_FWD(U) BOOST_FWD_REF(U)
33 #else
34 #define BOOST_MOVE_CATCH_CONST(U)  const U &
35 #define BOOST_MOVE_CATCH_RVALUE(U) U &&
36 #define BOOST_MOVE_CATCH_FWD(U)    U &&
37 #endif
38
39 #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
40 #define BOOST_MOVE_CONVERSION_AWARE_CATCH(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION)\
41    RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_CONST(TYPE) x)\
42    {  return FWD_FUNCTION(static_cast<const TYPE&>(x)); }\
43 \
44    RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_RVALUE(TYPE) x) \
45    {  return FWD_FUNCTION(::boost::move(x));  }\
46 \
47    RETURN_VALUE PUB_FUNCTION(TYPE &x)\
48    {  return FWD_FUNCTION(const_cast<const TYPE &>(x)); }\
49 \
50    template<class BOOST_MOVE_TEMPL_PARAM>\
51    typename ::boost::move_detail::enable_if_and\
52                      < RETURN_VALUE \
53                      , ::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>\
54                      , ::boost::move_detail::is_class_or_union<TYPE>\
55                      , ::boost::has_move_emulation_disabled<BOOST_MOVE_TEMPL_PARAM>\
56                      >::type\
57    PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\
58    { return FWD_FUNCTION(u); }\
59 \
60    template<class BOOST_MOVE_TEMPL_PARAM>\
61    typename ::boost::move_detail::disable_if_or\
62                      < RETURN_VALUE \
63                      , ::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM> \
64                      , ::boost::move_detail::and_ \
65                         < ::boost::move_detail::is_rv<BOOST_MOVE_TEMPL_PARAM> \
66                         , ::boost::move_detail::is_class_or_union<BOOST_MOVE_TEMPL_PARAM> \
67                         > \
68                      >::type\
69    PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\
70    {\
71       TYPE t(u);\
72       return FWD_FUNCTION(::boost::move(t));\
73    }\
74 //
75
76 #elif (defined(_MSC_VER) && (_MSC_VER == 1600))
77
78 #define BOOST_MOVE_CONVERSION_AWARE_CATCH(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION)\
79    RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_CONST(TYPE) x)\
80    {  return FWD_FUNCTION(static_cast<const TYPE&>(x)); }\
81 \
82    RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_RVALUE(TYPE) x) \
83    {  return FWD_FUNCTION(::boost::move(x));  }\
84 \
85    template<class BOOST_MOVE_TEMPL_PARAM>\
86    typename ::boost::move_detail::enable_if_c\
87                      < !::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value\
88                      , RETURN_VALUE >::type\
89    PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\
90    {\
91       TYPE t(u);\
92       return FWD_FUNCTION(::boost::move(t));\
93    }\
94 //
95
96 #else
97
98 #define BOOST_MOVE_CONVERSION_AWARE_CATCH(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION)\
99    RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_CONST(TYPE) x)\
100    {  return FWD_FUNCTION(static_cast<const TYPE&>(x)); }\
101 \
102    RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_RVALUE(TYPE) x) \
103    {  return FWD_FUNCTION(::boost::move(x));  }\
104 //
105
106 #endif
107
108
109 #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
110
111 #define BOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION, ARG1, UNLESS_CONVERTIBLE_TO)\
112    RETURN_VALUE PUB_FUNCTION(ARG1 arg1, BOOST_MOVE_CATCH_CONST(TYPE) x)\
113    {  return FWD_FUNCTION(arg1, static_cast<const TYPE&>(x)); }\
114 \
115    RETURN_VALUE PUB_FUNCTION(ARG1 arg1, BOOST_MOVE_CATCH_RVALUE(TYPE) x) \
116    {  return FWD_FUNCTION(arg1, ::boost::move(x));  }\
117 \
118    RETURN_VALUE PUB_FUNCTION(ARG1 arg1, TYPE &x)\
119    {  return FWD_FUNCTION(arg1, const_cast<const TYPE &>(x)); }\
120 \
121    template<class BOOST_MOVE_TEMPL_PARAM>\
122    typename ::boost::move_detail::enable_if_and\
123                      < RETURN_VALUE \
124                      , ::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>\
125                      , ::boost::has_move_emulation_disabled<BOOST_MOVE_TEMPL_PARAM>\
126                      >::type\
127    PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\
128    { return FWD_FUNCTION(arg1, u); }\
129 \
130    template<class BOOST_MOVE_TEMPL_PARAM>\
131    typename ::boost::move_detail::disable_if_or\
132                      < RETURN_VALUE \
133                      , ::boost::move_detail::is_rv<BOOST_MOVE_TEMPL_PARAM>\
134                      , ::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>\
135                      , ::boost::move_detail::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO>\
136                      >::type\
137    PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\
138    {\
139       TYPE t(u);\
140       return FWD_FUNCTION(arg1, ::boost::move(t));\
141    }\
142 //
143
144 #elif (defined(_MSC_VER) && (_MSC_VER == 1600))
145
146 #define BOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION, ARG1, UNLESS_CONVERTIBLE_TO)\
147    RETURN_VALUE PUB_FUNCTION(ARG1 arg1, BOOST_MOVE_CATCH_CONST(TYPE) x)\
148    {  return FWD_FUNCTION(arg1, static_cast<const TYPE&>(x)); }\
149 \
150    RETURN_VALUE PUB_FUNCTION(ARG1 arg1, BOOST_MOVE_CATCH_RVALUE(TYPE) x) \
151    {  return FWD_FUNCTION(arg1, ::boost::move(x));  }\
152 \
153    template<class BOOST_MOVE_TEMPL_PARAM>\
154    typename ::boost::move_detail::disable_if_or\
155                      < RETURN_VALUE \
156                      , ::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM> \
157                      , ::boost::move_detail::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO> \
158                      >::type\
159    PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\
160    {\
161       TYPE t(u);\
162       return FWD_FUNCTION(arg1, ::boost::move(t));\
163    }\
164 //
165
166 #else
167
168 #define BOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION, ARG1, UNLESS_CONVERTIBLE_TO)\
169    RETURN_VALUE PUB_FUNCTION(ARG1 arg1, BOOST_MOVE_CATCH_CONST(TYPE) x)\
170    {  return FWD_FUNCTION(arg1, static_cast<const TYPE&>(x)); }\
171 \
172    RETURN_VALUE PUB_FUNCTION(ARG1 arg1, BOOST_MOVE_CATCH_RVALUE(TYPE) x) \
173    {  return FWD_FUNCTION(arg1, ::boost::move(x));  }\
174 //
175
176 #endif
177
178 #endif //#ifndef BOOST_MOVE_MOVE_HELPERS_HPP