File indexing completed on 2026-04-08 08:10:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef BOOST_MOVE_MOVE_UTILITY_HPP
0017 #define BOOST_MOVE_MOVE_UTILITY_HPP
0018
0019 #ifndef BOOST_CONFIG_HPP
0020 # include <boost/config.hpp>
0021 #endif
0022 0023 ">#
0024 #if defined(BOOST_HAS_PRAGMA_ONCE)
0025 # pragma once
0026 #endif
0027
0028 #include <boost/move/detail/config_begin.hpp>
0029 #include <boost/move/detail/workaround.hpp> //forceinline
0030 #include <boost/move/utility_core.hpp>
0031 #include <boost/move/traits.hpp>
0032
0033 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
0034
0035 namespace boost {
0036
0037
0038
0039
0040
0041
0042
0043 template <class T>
0044 BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
0045 < enable_move_utility_emulation<T>::value && !has_move_emulation_enabled<T>::value
0046 , typename ::boost::move_detail::add_const<T>::type &
0047 >::type
0048 move_if_noexcept(T& x) BOOST_NOEXCEPT
0049 {
0050 return x;
0051 }
0052
0053 template <class T>
0054 BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
0055 < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
0056 && ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, rv<T>&>::type
0057 move_if_noexcept(T& x) BOOST_NOEXCEPT
0058 {
0059 return *static_cast<rv<T>* >(::boost::move_detail::addressof(x));
0060 }
0061
0062 template <class T>
0063 BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
0064 < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
0065 && ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
0066 , rv<T>&
0067 >::type
0068 move_if_noexcept(rv<T>& x) BOOST_NOEXCEPT
0069 {
0070 return x;
0071 }
0072
0073 template <class T>
0074 BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
0075 < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
0076 && !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
0077 , typename ::boost::move_detail::add_const<T>::type &
0078 >::type
0079 move_if_noexcept(T& x) BOOST_NOEXCEPT
0080 {
0081 return x;
0082 }
0083
0084 template <class T>
0085 BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
0086 < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
0087 && !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
0088 , typename ::boost::move_detail::add_const<T>::type &
0089 >::type
0090 move_if_noexcept(rv<T>& x) BOOST_NOEXCEPT
0091 {
0092 return x;
0093 }
0094
0095 }
0096
0097 #else
0098
0099 #if defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
0100 #include <utility>
0101
0102 namespace boost{
0103
0104 using ::std::move_if_noexcept;
0105
0106 }
0107
0108 #else
0109
0110 namespace boost {
0111
0112
0113
0114
0115
0116
0117 #if defined(BOOST_MOVE_DOXYGEN_INVOKED)
0118
0119
0120
0121
0122
0123
0124 template <class T>
0125 rvalue_reference_or_const_lvalue_reference move_if_noexcept(input_reference) noexcept;
0126
0127 #else
0128
0129 template <class T>
0130 BOOST_MOVE_INTRINSIC_CAST typename ::boost::move_detail::enable_if_c
0131 < ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, T&&>::type
0132 move_if_noexcept(T& x) BOOST_NOEXCEPT
0133 { return ::boost::move(x); }
0134
0135 template <class T>
0136 BOOST_MOVE_INTRINSIC_CAST typename ::boost::move_detail::enable_if_c
0137 < !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, const T&>::type
0138 move_if_noexcept(T& x) BOOST_NOEXCEPT
0139 { return x; }
0140
0141 #endif
0142
0143 }
0144
0145 #endif
0146
0147 #endif
0148
0149 #include <boost/move/detail/config_end.hpp>
0150
0151 #endif