123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- #ifndef BOOST_MOVE_MOVE_UTILITY_HPP
- #define BOOST_MOVE_MOVE_UTILITY_HPP
- #ifndef BOOST_CONFIG_HPP
- # include <boost/config.hpp>
- #endif
- #
- #if defined(BOOST_HAS_PRAGMA_ONCE)
- # pragma once
- #endif
- #include <boost/move/detail/config_begin.hpp>
- #include <boost/move/detail/workaround.hpp> //forceinline
- #include <boost/move/utility_core.hpp>
- #include <boost/move/traits.hpp>
- #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
- namespace boost {
-
-
-
-
-
- template <class T>
- BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
- < enable_move_utility_emulation<T>::value && !has_move_emulation_enabled<T>::value
- , typename ::boost::move_detail::add_const<T>::type &
- >::type
- move_if_noexcept(T& x) BOOST_NOEXCEPT
- {
- return x;
- }
- template <class T>
- BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
- < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
- && ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, rv<T>&>::type
- move_if_noexcept(T& x) BOOST_NOEXCEPT
- {
- return *static_cast<rv<T>* >(::boost::move_detail::addressof(x));
- }
- template <class T>
- BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
- < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
- && ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
- , rv<T>&
- >::type
- move_if_noexcept(rv<T>& x) BOOST_NOEXCEPT
- {
- return x;
- }
- template <class T>
- BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
- < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
- && !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
- , typename ::boost::move_detail::add_const<T>::type &
- >::type
- move_if_noexcept(T& x) BOOST_NOEXCEPT
- {
- return x;
- }
- template <class T>
- BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
- < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
- && !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
- , typename ::boost::move_detail::add_const<T>::type &
- >::type
- move_if_noexcept(rv<T>& x) BOOST_NOEXCEPT
- {
- return x;
- }
- }
- #else
- #if defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
- #include <utility>
- namespace boost{
- using ::std::move_if_noexcept;
- }
- #else
- namespace boost {
-
-
-
-
-
- #if defined(BOOST_MOVE_DOXYGEN_INVOKED)
-
-
-
-
-
-
- template <class T>
- rvalue_reference_or_const_lvalue_reference move_if_noexcept(input_reference) noexcept;
- #else
- template <class T>
- BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
- < ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, T&&>::type
- move_if_noexcept(T& x) BOOST_NOEXCEPT
- { return ::boost::move(x); }
- template <class T>
- BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
- < !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, const T&>::type
- move_if_noexcept(T& x) BOOST_NOEXCEPT
- { return x; }
- #endif
- }
- #endif
- #endif
- #include <boost/move/detail/config_end.hpp>
- #endif
|