16 #ifndef BOOST_MOVE_CORE_HPP 17 #define BOOST_MOVE_CORE_HPP 19 #ifndef BOOST_CONFIG_HPP 23 #if defined(BOOST_HAS_PRAGMA_ONCE) 32 #if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES) 33 #define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \ 36 TYPE& operator=(TYPE &);\ 38 typedef int boost_move_no_copy_constructor_or_assign; \ 42 #define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \ 44 TYPE(TYPE const &) = delete;\ 45 TYPE& operator=(TYPE const &) = delete;\ 47 typedef int boost_move_no_copy_constructor_or_assign; \ 50 #endif //BOOST_NO_CXX11_DELETED_FUNCTIONS 52 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED) 57 #if defined(__GNUC__) && (__GNUC__ >= 4) && \ 59 defined(BOOST_GCC) || \ 60 (defined(BOOST_INTEL) && (BOOST_INTEL_CXX_VERSION >= 1300)) \ 62 #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__)) 64 #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS 77 < ::boost::move_detail::is_class<T>::value
79 , ::boost::move_detail::nat
85 void operator=(rv
const&);
86 } BOOST_MOVE_ATTRIBUTE_MAY_ALIAS;
95 namespace move_detail {
101 : integral_constant<bool, ::boost::move_detail::is_rv_impl<T>::value >
112 struct has_move_emulation_enabled
118 #define BOOST_RV_REF(TYPE)\ 119 ::boost::rv< TYPE >& \ 122 #define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\ 123 ::boost::rv< TYPE<ARG1, ARG2> >& \ 126 #define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\ 127 ::boost::rv< TYPE<ARG1, ARG2, ARG3> >& \ 130 #define BOOST_RV_REF_BEG\ 134 #define BOOST_RV_REF_END\ 138 #define BOOST_FWD_REF(TYPE)\ 142 #define BOOST_COPY_ASSIGN_REF(TYPE)\ 143 const ::boost::rv< TYPE >& \ 146 #define BOOST_COPY_ASSIGN_REF_BEG \ 150 #define BOOST_COPY_ASSIGN_REF_END \ 154 #define BOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\ 155 const ::boost::rv< TYPE<ARG1, ARG2> >& \ 158 #define BOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\ 159 const ::boost::rv< TYPE<ARG1, ARG2, ARG3> >& \ 162 #define BOOST_CATCH_CONST_RLVALUE(TYPE)\ 163 const ::boost::rv< TYPE >& \ 167 namespace move_detail {
169 template <
class Ret,
class T>
170 inline typename ::boost::move_detail::enable_if_c
179 template <
class Ret,
class T>
180 inline typename ::boost::move_detail::enable_if_c
189 template <
class Ret,
class T>
190 inline typename ::boost::move_detail::enable_if_c
192 ::boost::has_move_emulation_enabled<T>::value
202 #define BOOST_MOVE_RET(RET_TYPE, REF)\ 203 boost::move_detail::move_return< RET_TYPE >(REF) 206 #define BOOST_MOVE_BASE(BASE_TYPE, ARG) \ 207 ::boost::move((BASE_TYPE&)(ARG)) 215 #define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\ 216 BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\ 218 operator ::boost::rv<TYPE>&() \ 219 { return *static_cast< ::boost::rv<TYPE>* >(this); }\ 220 operator const ::boost::rv<TYPE>&() const \ 221 { return *static_cast<const ::boost::rv<TYPE>* >(this); }\ 231 #define BOOST_COPYABLE_AND_MOVABLE(TYPE)\ 233 TYPE& operator=(TYPE &t)\ 234 { this->operator=(static_cast<const ::boost::rv<TYPE> &>(const_cast<const TYPE &>(t))); return *this;}\ 236 operator ::boost::rv<TYPE>&() \ 237 { return *static_cast< ::boost::rv<TYPE>* >(this); }\ 238 operator const ::boost::rv<TYPE>&() const \ 239 { return *static_cast<const ::boost::rv<TYPE>* >(this); }\ 243 #define BOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\ 245 operator ::boost::rv<TYPE>&() \ 246 { return *static_cast< ::boost::rv<TYPE>* >(this); }\ 247 operator const ::boost::rv<TYPE>&() const \ 248 { return *static_cast<const ::boost::rv<TYPE>* >(this); }\ 253 namespace move_detail{
257 {
typedef const T &
type; };
260 struct forward_type< boost::rv<T> >
265 #else //BOOST_NO_CXX11_RVALUE_REFERENCES 270 #define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\ 271 BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\ 273 typedef int boost_move_emulation_t;\ 279 #define BOOST_COPYABLE_AND_MOVABLE(TYPE)\ 282 #if !defined(BOOST_MOVE_DOXYGEN_INVOKED) 283 #define BOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\ 285 #endif //#if !defined(BOOST_MOVE_DOXYGEN_INVOKED) 303 #define BOOST_RV_REF(TYPE)\ 313 #define BOOST_RV_REF_BEG\ 323 #define BOOST_RV_REF_END\ 326 #define BOOST_COPY_ASSIGN_REF(TYPE)\ 334 #define BOOST_FWD_REF(TYPE)\ 338 #if !defined(BOOST_MOVE_DOXYGEN_INVOKED) 340 #define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\ 341 TYPE<ARG1, ARG2> && \ 344 #define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\ 345 TYPE<ARG1, ARG2, ARG3> && \ 348 #define BOOST_COPY_ASSIGN_REF_BEG \ 352 #define BOOST_COPY_ASSIGN_REF_END \ 356 #define BOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\ 357 const TYPE<ARG1, ARG2> & \ 360 #define BOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\ 361 const TYPE<ARG1, ARG2, ARG3>& \ 364 #define BOOST_CATCH_CONST_RLVALUE(TYPE)\ 368 #endif //#if !defined(BOOST_MOVE_DOXYGEN_INVOKED) 370 #if !defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED) 392 #define BOOST_MOVE_RET(RET_TYPE, REF)\ 401 namespace move_detail {
403 template <
class Ret,
class T>
404 inline typename ::boost::move_detail::enable_if_c
412 template <
class Ret,
class T>
413 inline typename ::boost::move_detail::enable_if_c
414 < !::boost::move_detail::is_lvalue_reference<Ret>::value
418 return static_cast< Ret&&
>(
t);
424 #define BOOST_MOVE_RET(RET_TYPE, REF)\ 425 boost::move_detail::move_return< RET_TYPE >(REF) 430 #define BOOST_MOVE_BASE(BASE_TYPE, ARG) \ 438 ::boost::move((BASE_TYPE&)(ARG)) 442 namespace move_detail {
448 #endif //BOOST_NO_CXX11_RVALUE_REFERENCES 452 #endif //#ifndef BOOST_MOVE_CORE_HPP BOOST_FORCEINLINE T * addressof(T &v)
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.