diff options
Diffstat (limited to 'boost/container/detail/pair.hpp')
-rw-r--r-- | boost/container/detail/pair.hpp | 56 |
1 files changed, 10 insertions, 46 deletions
diff --git a/boost/container/detail/pair.hpp b/boost/container/detail/pair.hpp index b7ad84c80e..6d31d3b796 100644 --- a/boost/container/detail/pair.hpp +++ b/boost/container/detail/pair.hpp @@ -13,7 +13,11 @@ #ifndef BOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP #define BOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif + +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -24,17 +28,11 @@ #include <boost/container/detail/type_traits.hpp> #include <boost/container/detail/mpl.hpp> #include <boost/container/detail/type_traits.hpp> +#include <boost/move/adl_move_swap.hpp> //swap -#include <utility> //std::pair -#include <algorithm> //std::swap - +#include <boost/intrusive/detail/minimal_pair_header.hpp> //pair #include <boost/move/utility_core.hpp> - -#ifndef BOOST_CONTAINER_PERFECT_FORWARDING -#include <boost/container/detail/preprocessor.hpp> -#endif - namespace boost { namespace container { namespace container_detail { @@ -166,37 +164,7 @@ struct pair //template <class... Args1, class... Args2> // pair(piecewise_construct_t, tuple<Args1...> first_args, // tuple<Args2...> second_args); -/* - //Variadic versions - template<class U> - pair(BOOST_CONTAINER_PP_PARAM(U, u), typename container_detail::disable_if - < container_detail::is_pair< typename container_detail::remove_ref_const<U>::type >, pair_nat>::type* = 0) - : first(::boost::forward<U>(u)) - , second() - {} - - #ifdef BOOST_CONTAINER_PERFECT_FORWARDING - template<class U, class V, class ...Args> - pair(U &&u, V &&v) - : first(::boost::forward<U>(u)) - , second(::boost::forward<V>(v), ::boost::forward<Args>(args)...) - {} - - #else - - #define BOOST_PP_LOCAL_MACRO(n) \ - template<class U, BOOST_PP_ENUM_PARAMS(n, class P)> \ - pair(BOOST_CONTAINER_PP_PARAM(U, u) \ - ,BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - : first(::boost::forward<U>(u)) \ - , second(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)) \ - {} \ - //! - #define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) - #include BOOST_PP_LOCAL_ITERATE() - #endif -*/ //pair copy assignment pair& operator=(BOOST_COPY_ASSIGN_REF(pair) p) { @@ -272,9 +240,8 @@ struct pair //swap void swap(pair& p) { - using std::swap; - swap(this->first, p.first); - swap(this->second, p.second); + ::boost::adl_move_swap(this->first, p.first); + ::boost::adl_move_swap(this->second, p.second); } }; @@ -309,10 +276,7 @@ inline pair<T1, T2> make_pair(T1 x, T2 y) template <class T1, class T2> inline void swap(pair<T1, T2>& x, pair<T1, T2>& y) -{ - swap(x.first, y.first); - swap(x.second, y.second); -} +{ x.swap(y); } } //namespace container_detail { } //namespace container { |