Ticket #8765: move_noexcept.patch
File move_noexcept.patch, 4.1 KB (added by , 9 years ago) |
---|
-
utility.hpp
37 37 template <class T> 38 38 inline typename ::boost::move_detail::enable_if_c 39 39 < enable_move_utility_emulation<T>::value && !has_move_emulation_enabled<T>::value, T&>::type 40 move(T& x) 40 move(T& x) BOOST_NOEXCEPT 41 41 { 42 42 return x; 43 43 } … … 45 45 template <class T> 46 46 inline typename ::boost::move_detail::enable_if_c 47 47 < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value, rv<T>&>::type 48 move(T& x) 48 move(T& x) BOOST_NOEXCEPT 49 49 { 50 50 return *static_cast<rv<T>* >(::boost::move_detail::addressof(x)); 51 51 } … … 53 53 template <class T> 54 54 inline typename ::boost::move_detail::enable_if_c 55 55 < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value, rv<T>&>::type 56 move(rv<T>& x) 56 move(rv<T>& x) BOOST_NOEXCEPT 57 57 { 58 58 return x; 59 59 } … … 67 67 template <class T> 68 68 inline typename ::boost::move_detail::enable_if_c 69 69 < enable_move_utility_emulation<T>::value && ::boost::move_detail::is_rv<T>::value, T &>::type 70 forward(const typename ::boost::move_detail::identity<T>::type &x) 70 forward(const typename ::boost::move_detail::identity<T>::type &x) BOOST_NOEXCEPT 71 71 { 72 72 return const_cast<T&>(x); 73 73 } … … 75 75 template <class T> 76 76 inline typename ::boost::move_detail::enable_if_c 77 77 < enable_move_utility_emulation<T>::value && !::boost::move_detail::is_rv<T>::value, const T &>::type 78 forward(const typename ::boost::move_detail::identity<T>::type &x) 78 forward(const typename ::boost::move_detail::identity<T>::type &x) BOOST_NOEXCEPT 79 79 { 80 80 return x; 81 81 } … … 123 123 //! in compilers with rvalue references. For other compilers converts T & into 124 124 //! <i>::boost::rv<T> &</i> so that move emulation is activated. 125 125 template <class T> 126 rvalue_reference move (input_reference) ;126 rvalue_reference move (input_reference) noexcept; 127 127 128 128 #elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES) 129 129 130 130 //Old move approach, lvalues could bind to rvalue references 131 131 template <class T> 132 inline typename remove_reference<T>::type && move(T&& t) 132 inline typename remove_reference<T>::type && move(T&& t) BOOST_NOEXCEPT 133 133 { return t; } 134 134 135 135 #else //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES 136 136 137 137 template <class T> 138 inline typename remove_reference<T>::type && move(T&& t) 138 inline typename remove_reference<T>::type && move(T&& t) BOOST_NOEXCEPT 139 139 { return static_cast<typename remove_reference<T>::type &&>(t); } 140 140 141 141 #endif //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES … … 159 159 //! ::boost::rv<T> & 160 160 //! 161 161 //! * Else, output_reference is equal to input_reference. 162 template <class T> output_reference forward(input_reference) ;162 template <class T> output_reference forward(input_reference) noexcept; 163 163 #elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES) 164 164 165 165 //Old move approach, lvalues could bind to rvalue references 166 166 167 167 template <class T> 168 inline T&& forward (typename ::boost::move_detail::identity<T>::type&& t) 168 inline T&& forward (typename ::boost::move_detail::identity<T>::type&& t) BOOST_NOEXCEPT 169 169 { return t; } 170 170 171 171 #else //Old move … … 178 178 move_detail::is_lvalue_reference<T>::value ? move_detail::is_lvalue_reference<U>::value : true>::type * = 0/* 179 179 , typename ::boost::move_detail::enable_if_c< 180 180 move_detail::is_convertible 181 <typename remove_reference<U>::type*, typename remove_reference<T>::type*>::value>::type * = 0*/) 181 <typename remove_reference<U>::type*, typename remove_reference<T>::type*>::value>::type * = 0*/) BOOST_NOEXCEPT 182 182 { return static_cast<T&&>(t); } 183 183 184 184 #endif //BOOST_MOVE_DOXYGEN_INVOKED