Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:29:39

0001 //////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga 2005-2013.
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // See http://www.boost.org/libs/container for documentation.
0010 //
0011 //////////////////////////////////////////////////////////////////////////////
0012 
0013 #ifndef BOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP
0014 #define BOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP
0015 
0016 #ifndef BOOST_CONFIG_HPP
0017 #  include <boost/config.hpp>
0018 #endif
0019 
0020 #if defined(BOOST_HAS_PRAGMA_ONCE)
0021 #  pragma once
0022 #endif
0023 
0024 #include <boost/container/detail/config_begin.hpp>
0025 #include <boost/container/container_fwd.hpp>
0026 #include <boost/container/detail/workaround.hpp>
0027 
0028 #include <boost/container/detail/mpl.hpp>
0029 #include <boost/container/detail/type_traits.hpp>
0030 #include <boost/container/detail/mpl.hpp>
0031 #include <boost/container/detail/std_fwd.hpp>
0032 #include <boost/container/detail/is_pair.hpp>   //Forward declares boost::tuples::tuple
0033 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0034 #  include <boost/container/detail/variadic_templates_tools.hpp>
0035 #endif
0036 #include <boost/move/adl_move_swap.hpp> //swap
0037 
0038 #include <boost/intrusive/detail/minimal_pair_header.hpp>      //pair
0039 #include <boost/move/utility_core.hpp>
0040 #include <boost/move/detail/fwd_macros.hpp>
0041 
0042 namespace boost {
0043 namespace container {
0044 namespace pair_impl {
0045 
0046 template <class TupleClass>
0047 struct is_boost_tuple
0048 {
0049    BOOST_STATIC_CONSTEXPR bool value = false;
0050 };
0051 
0052 template <
0053   class T0, class T1, class T2,
0054   class T3, class T4, class T5,
0055   class T6, class T7, class T8,
0056   class T9>
0057 struct is_boost_tuple< boost::tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
0058 {
0059    BOOST_STATIC_CONSTEXPR bool value = true;
0060 };
0061 
0062 template<class Tuple>
0063 struct disable_if_boost_tuple
0064    : boost::container::dtl::disable_if< is_boost_tuple<Tuple> >
0065 {};
0066 
0067 template<class T>
0068 struct is_tuple_null
0069 {
0070    BOOST_STATIC_CONSTEXPR bool value = false;
0071 };
0072 
0073 template<>
0074 struct is_tuple_null<boost::tuples::null_type>
0075 {
0076    BOOST_STATIC_CONSTEXPR bool value = true;
0077 };
0078 
0079 }  //namespace detail {
0080 
0081 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
0082 
0083    template <int Dummy = 0>
0084    struct std_piecewise_construct_holder
0085    {
0086       static ::std::piecewise_construct_t *dummy;
0087    };
0088 
0089    template <int Dummy>
0090    ::std::piecewise_construct_t *std_piecewise_construct_holder<Dummy>::dummy =
0091       reinterpret_cast< ::std::piecewise_construct_t *>(0x01234);  //Avoid sanitizer errors on references to null pointers
0092 
0093 #else
0094 
0095 //! The piecewise_construct_t struct is an empty structure type used as a unique type to
0096 //! disambiguate used to disambiguate between different functions that take two tuple arguments.
0097 typedef unspecified piecewise_construct_t;
0098 
0099 #endif   //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
0100 
0101 //! A instance of type
0102 //! piecewise_construct_t
0103 static piecewise_construct_t piecewise_construct = BOOST_CONTAINER_DOC1ST(unspecified, *std_piecewise_construct_holder<>::dummy);
0104 
0105 ///@cond
0106 
0107 namespace dtl {
0108 
0109 struct piecewise_construct_use
0110 {
0111    //Avoid warnings of unused "piecewise_construct"
0112    piecewise_construct_use()
0113    {  (void)&::boost::container::piecewise_construct;   }
0114 };
0115 
0116 struct pair_nat;
0117 
0118 template<typename T, typename U, typename V>
0119 void get(T); //to enable ADL
0120 
0121 ///@endcond
0122 
0123 #ifdef  _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
0124 //Libc++, in some versions, has an ABI breakage that needs some
0125 //padding in dtl::pair, as "std::pair::first" is not at offset zero.
0126 //See: https://reviews.llvm.org/D56357 for more information.
0127 //
0128 template <class T1, class T2, std::size_t N>
0129 struct pair_padding
0130 {
0131    char padding[N];
0132 };
0133 
0134 template <class T1, class T2>
0135 struct pair_padding<T1, T2, 0>
0136 {
0137 };
0138 
0139 template <class T1, class T2>
0140 struct simple_pair
0141 {
0142    T1 first;
0143    T2 second;
0144 };
0145 
0146 #endif
0147 
0148 template <class T1, class T2>
0149 struct pair
0150 #ifdef  _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
0151    : pair_padding<T1, T2, sizeof(std::pair<T1, T2>) - sizeof(simple_pair<T1, T2>)>
0152 #endif
0153 {
0154    private:
0155    BOOST_COPYABLE_AND_MOVABLE(pair)
0156 
0157    public:
0158    typedef T1 first_type;
0159    typedef T2 second_type;
0160 
0161    T1 first;
0162    T2 second;
0163 
0164    //Default constructor
0165    pair()
0166       : first(), second()
0167    {
0168       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0169    }
0170 
0171    //pair copy assignment
0172    pair(const pair& x)
0173       : first(x.first), second(x.second)
0174    {
0175       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0176    }
0177 
0178    //pair move constructor
0179    pair(BOOST_RV_REF(pair) p)
0180       : first(::boost::move(BOOST_MOVE_TO_LV(p).first)), second(::boost::move(BOOST_MOVE_TO_LV(p).second))
0181    {
0182       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0183    }
0184 
0185    template <class D, class S>
0186    pair(const pair<D, S> &p)
0187       : first(p.first), second(p.second)
0188    {
0189       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0190    }
0191 
0192    template <class D, class S>
0193    pair(BOOST_RV_REF_BEG pair<D, S> BOOST_RV_REF_END p)
0194       : first(::boost::move(BOOST_MOVE_TO_LV(p).first)), second(::boost::move(BOOST_MOVE_TO_LV(p).second))
0195    {
0196       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0197    }
0198 
0199    //pair from two values
0200    pair(const T1 &t1, const T2 &t2)
0201       : first(t1)
0202       , second(t2)
0203    {
0204       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0205    }
0206 
0207    template<class U, class V>
0208    pair(BOOST_FWD_REF(U) u, BOOST_FWD_REF(V) v)
0209       : first(::boost::forward<U>(u))
0210       , second(::boost::forward<V>(v))
0211    {
0212       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0213    }
0214 
0215    //And now compatibility with std::pair
0216    pair(const std::pair<T1, T2>& x)
0217       : first(x.first), second(x.second)
0218    {
0219       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0220    }
0221 
0222    template <class D, class S>
0223    pair(const std::pair<D, S>& p)
0224       : first(p.first), second(p.second)
0225    {
0226       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0227    }
0228 
0229    pair(BOOST_RV_REF_BEG std::pair<T1, T2> BOOST_RV_REF_END p)
0230       : first(::boost::move(BOOST_MOVE_TO_LV(p).first)), second(::boost::move(BOOST_MOVE_TO_LV(p).second))
0231    {
0232       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0233    }
0234 
0235    template <class D, class S>
0236    pair(BOOST_RV_REF_BEG std::pair<D, S> BOOST_RV_REF_END p)
0237       : first(::boost::move(BOOST_MOVE_TO_LV(p).first)), second(::boost::move(BOOST_MOVE_TO_LV(p).second))
0238    {
0239       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0240    }
0241 
0242    #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0243    template< class KeyType, class ...Args>
0244    pair(try_emplace_t, BOOST_FWD_REF(KeyType) k, Args && ...args)
0245       : first(boost::forward<KeyType>(k)), second(::boost::forward<Args>(args)...)\
0246    {
0247       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0248    }
0249    #else
0250 
0251    //piecewise construction from boost::tuple
0252    #define BOOST_PAIR_TRY_EMPLACE_CONSTRUCT_CODE(N)\
0253    template< class KeyType BOOST_MOVE_I##N BOOST_MOVE_CLASS##N > \
0254    pair( try_emplace_t, BOOST_FWD_REF(KeyType) k BOOST_MOVE_I##N BOOST_MOVE_UREF##N )\
0255       : first(boost::forward<KeyType>(k)), second(BOOST_MOVE_FWD##N)\
0256    {\
0257       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));\
0258    }\
0259    //
0260    BOOST_MOVE_ITERATE_0TO9(BOOST_PAIR_TRY_EMPLACE_CONSTRUCT_CODE)
0261    #undef BOOST_PAIR_TRY_EMPLACE_CONSTRUCT_CODE
0262 
0263    #endif   //BOOST_NO_CXX11_VARIADIC_TEMPLATES
0264 
0265    //piecewise construction from boost::tuple
0266    #define BOOST_PAIR_PIECEWISE_CONSTRUCT_BOOST_TUPLE_CODE(N,M)\
0267    template< template<class, class, class, class, class, class, class, class, class, class> class BoostTuple \
0268             BOOST_MOVE_I_IF(BOOST_MOVE_OR(N,M)) BOOST_MOVE_CLASS##N BOOST_MOVE_I_IF(BOOST_MOVE_AND(N,M)) BOOST_MOVE_CLASSQ##M > \
0269    pair( piecewise_construct_t\
0270        , BoostTuple<BOOST_MOVE_TARG##N  BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,N),::boost::tuples::null_type)> p\
0271        , BoostTuple<BOOST_MOVE_TARGQ##M BOOST_MOVE_I##M BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,M),::boost::tuples::null_type)> q\
0272        , typename dtl::enable_if_c\
0273          < pair_impl::is_boost_tuple< BoostTuple<BOOST_MOVE_TARG##N  BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,N),::boost::tuples::null_type)> >::value &&\
0274            !(pair_impl::is_tuple_null<BOOST_MOVE_LAST_TARG##N>::value || pair_impl::is_tuple_null<BOOST_MOVE_LAST_TARGQ##M>::value) \
0275          >::type* = 0\
0276        )\
0277       : first(BOOST_MOVE_TMPL_GET##N), second(BOOST_MOVE_TMPL_GETQ##M)\
0278    { (void)p; (void)q;\
0279       BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));\
0280    }\
0281    //
0282    BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_PAIR_PIECEWISE_CONSTRUCT_BOOST_TUPLE_CODE)
0283    #undef BOOST_PAIR_PIECEWISE_CONSTRUCT_BOOST_TUPLE_CODE
0284 
0285    //piecewise construction from variadic tuple (with delegating constructors)
0286    #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0287    #  if !defined(BOOST_CONTAINER_NO_CXX11_DELEGATING_CONSTRUCTORS)
0288       private:
0289       template<template<class ...> class Tuple, class... Args1, class... Args2, size_t... Indexes1, size_t... Indexes2>
0290       pair(Tuple<Args1...>& t1, Tuple<Args2...>& t2, index_tuple<Indexes1...>, index_tuple<Indexes2...>)
0291          : first (::boost::forward<Args1>(get<Indexes1>(t1))...)
0292          , second(::boost::forward<Args2>(get<Indexes2>(t2))...)
0293       {  (void) t1; (void)t2; }
0294 
0295       public:
0296       template< template<class ...> class Tuple, class... Args1, class... Args2
0297               , class = typename pair_impl::disable_if_boost_tuple< Tuple<Args1...> >::type>
0298       pair(piecewise_construct_t, Tuple<Args1...> t1, Tuple<Args2...> t2)
0299          : pair(t1, t2, typename build_number_seq<sizeof...(Args1)>::type(), typename build_number_seq<sizeof...(Args2)>::type())
0300       {
0301          BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0302       }
0303    #  else
0304       //piecewise construction from variadic tuple (suboptimal, without delegating constructors)
0305       private:
0306       template<typename T, template<class ...> class Tuple, typename... Args>
0307       static T build_from_args(Tuple<Args...>&& t)
0308       {  return do_build_from_args<T>(::boost::move(t), typename build_number_seq<sizeof...(Args)>::type());   }
0309 
0310       template<typename T, template<class ...> class Tuple, typename... Args, std::size_t... Indexes>
0311       static T do_build_from_args(Tuple<Args...> && t, const index_tuple<Indexes...>&)
0312       {  (void)t; return T(::boost::forward<Args>(get<Indexes>(t))...);  }
0313 
0314       public:
0315       template< template<class ...> class Tuple, class... Args1, class... Args2
0316               , class = typename pair_impl::disable_if_boost_tuple< Tuple<Args1...> >::type>
0317       pair(piecewise_construct_t, Tuple<Args1...> t1, Tuple<Args2...> t2)
0318          : first  (build_from_args<first_type> (::boost::move(t1)))
0319          , second (build_from_args<second_type>(::boost::move(t2)))
0320       {
0321          BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));
0322       }
0323    #  endif   //BOOST_NO_CXX11_VARIADIC_TEMPLATES
0324    #elif defined(BOOST_MSVC) && (_CPPLIB_VER == 520)
0325       //MSVC 2010 tuple implementation
0326       #define BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2010_TUPLE_CODE(N,M)\
0327       template< template<class, class, class, class, class, class, class, class, class, class> class StdTuple \
0328                BOOST_MOVE_I_IF(BOOST_MOVE_OR(N,M)) BOOST_MOVE_CLASS##N BOOST_MOVE_I_IF(BOOST_MOVE_AND(N,M)) BOOST_MOVE_CLASSQ##M > \
0329       pair( piecewise_construct_t\
0330           , StdTuple<BOOST_MOVE_TARG##N  BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,N),::std::tr1::_Nil)> p\
0331           , StdTuple<BOOST_MOVE_TARGQ##M BOOST_MOVE_I##M BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(10,M),::std::tr1::_Nil)> q)\
0332          : first(BOOST_MOVE_GET_IDX##N), second(BOOST_MOVE_GET_IDXQ##M)\
0333       { (void)p; (void)q;\
0334          BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));\
0335       }\
0336       //
0337       BOOST_MOVE_ITER2D_0TOMAX(9, BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2010_TUPLE_CODE)
0338       #undef BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2010_TUPLE_CODE
0339    #elif defined(BOOST_MSVC) && (_CPPLIB_VER == 540)
0340       #if _VARIADIC_MAX >= 9
0341       #define BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_MAX_IT 9
0342       #else
0343       #define BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_MAX_IT BOOST_MOVE_ADD(_VARIADIC_MAX, 1)
0344       #endif
0345 
0346       //MSVC 2012 tuple implementation
0347       #define BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_CODE(N,M)\
0348       template< template<BOOST_MOVE_REPEAT(_VARIADIC_MAX, class), class, class, class> class StdTuple \
0349                BOOST_MOVE_I_IF(BOOST_MOVE_OR(N,M)) BOOST_MOVE_CLASS##N BOOST_MOVE_I_IF(BOOST_MOVE_AND(N,M)) BOOST_MOVE_CLASSQ##M > \
0350       pair( piecewise_construct_t\
0351           , StdTuple<BOOST_MOVE_TARG##N  BOOST_MOVE_I##N BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(BOOST_MOVE_ADD(_VARIADIC_MAX, 3),N),::std::_Nil) > p\
0352           , StdTuple<BOOST_MOVE_TARGQ##M BOOST_MOVE_I##M BOOST_MOVE_REPEAT(BOOST_MOVE_SUB(BOOST_MOVE_ADD(_VARIADIC_MAX, 3),M),::std::_Nil) > q)\
0353          : first(BOOST_MOVE_GET_IDX##N), second(BOOST_MOVE_GET_IDXQ##M)\
0354       { (void)p; (void)q;\
0355          BOOST_CONTAINER_STATIC_ASSERT((sizeof(std::pair<T1, T2>) == sizeof(pair<T1, T2>)));\
0356       }\
0357       //
0358       BOOST_MOVE_ITER2D_0TOMAX(BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_MAX_IT, BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_CODE)
0359       #undef BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2010_TUPLE_CODE
0360       #undef BOOST_PAIR_PIECEWISE_CONSTRUCT_MSVC2012_TUPLE_MAX_IT
0361    #endif
0362 
0363    //pair copy assignment
0364    pair& operator=(BOOST_COPY_ASSIGN_REF(pair) p)
0365    {
0366       first  = p.first;
0367       second = p.second;
0368       return *this;
0369    }
0370 
0371    //pair move assignment
0372    pair& operator=(BOOST_RV_REF(pair) p)
0373    {
0374       first  = ::boost::move(BOOST_MOVE_TO_LV(p).first);
0375       second = ::boost::move(BOOST_MOVE_TO_LV(p).second);
0376       return *this;
0377    }
0378 
0379    template <class D, class S>
0380    typename ::boost::container::dtl::disable_if_or
0381       < pair &
0382       , ::boost::container::dtl::is_same<T1, D>
0383       , ::boost::container::dtl::is_same<T2, S>
0384       >::type
0385       operator=(const pair<D, S>&p)
0386    {
0387       first  = p.first;
0388       second = p.second;
0389       return *this;
0390    }
0391 
0392    template <class D, class S>
0393    typename ::boost::container::dtl::disable_if_or
0394       < pair &
0395       , ::boost::container::dtl::is_same<T1, D>
0396       , ::boost::container::dtl::is_same<T2, S>
0397       >::type
0398       operator=(BOOST_RV_REF_BEG pair<D, S> BOOST_RV_REF_END p)
0399    {
0400       first  = ::boost::move(BOOST_MOVE_TO_LV(p).first);
0401       second = ::boost::move(BOOST_MOVE_TO_LV(p).second);
0402       return *this;
0403    }
0404 //std::pair copy assignment
0405    pair& operator=(const std::pair<T1, T2> &p)
0406    {
0407       first  = p.first;
0408       second = p.second;
0409       return *this;
0410    }
0411 
0412    template <class D, class S>
0413    pair& operator=(const std::pair<D, S> &p)
0414    {
0415       first  = ::boost::move(p.first);
0416       second = ::boost::move(p.second);
0417       return *this;
0418    }
0419 
0420    //std::pair move assignment
0421    pair& operator=(BOOST_RV_REF_BEG std::pair<T1, T2> BOOST_RV_REF_END p)
0422    {
0423       first  = ::boost::move(BOOST_MOVE_TO_LV(p).first);
0424       second = ::boost::move(BOOST_MOVE_TO_LV(p).second);
0425       return *this;
0426    }
0427 
0428    template <class D, class S>
0429    pair& operator=(BOOST_RV_REF_BEG std::pair<D, S> BOOST_RV_REF_END p)
0430    {
0431       first  = ::boost::move(BOOST_MOVE_TO_LV(p).first);
0432       second = ::boost::move(BOOST_MOVE_TO_LV(p).second);
0433       return *this;
0434    }
0435 
0436    //swap
0437    void swap(pair& p)
0438    {
0439       ::boost::adl_move_swap(this->first, p.first);
0440       ::boost::adl_move_swap(this->second, p.second);
0441    }
0442 };
0443 
0444 template <class T1, class T2>
0445 inline bool operator==(const pair<T1,T2>& x, const pair<T1,T2>& y)
0446 {  return static_cast<bool>(x.first == y.first && x.second == y.second);  }
0447 
0448 template <class T1, class T2>
0449 inline bool operator< (const pair<T1,T2>& x, const pair<T1,T2>& y)
0450 {  return static_cast<bool>(x.first < y.first ||
0451                          (!(y.first < x.first) && x.second < y.second)); }
0452 
0453 template <class T1, class T2>
0454 inline bool operator!=(const pair<T1,T2>& x, const pair<T1,T2>& y)
0455 {  return static_cast<bool>(!(x == y));  }
0456 
0457 template <class T1, class T2>
0458 inline bool operator> (const pair<T1,T2>& x, const pair<T1,T2>& y)
0459 {  return y < x;  }
0460 
0461 template <class T1, class T2>
0462 inline bool operator>=(const pair<T1,T2>& x, const pair<T1,T2>& y)
0463 {  return static_cast<bool>(!(x < y)); }
0464 
0465 template <class T1, class T2>
0466 inline bool operator<=(const pair<T1,T2>& x, const pair<T1,T2>& y)
0467 {  return static_cast<bool>(!(y < x)); }
0468 
0469 template <class T1, class T2>
0470 inline pair<T1, T2> make_pair(T1 x, T2 y)
0471 {  return pair<T1, T2>(x, y); }
0472 
0473 template <class T1, class T2>
0474 inline void swap(pair<T1, T2>& x, pair<T1, T2>& y)
0475 {  x.swap(y);  }
0476 
0477 }  //namespace dtl {
0478 }  //namespace container {
0479 
0480 #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
0481 
0482 template<class T1, class T2>
0483 struct has_move_emulation_enabled< ::boost::container::dtl::pair<T1, T2> >
0484 {
0485    BOOST_STATIC_CONSTEXPR bool value = true;
0486 };
0487 
0488 #endif
0489 
0490 namespace move_detail{
0491 
0492 template<class T>
0493 struct is_class_or_union;
0494 
0495 template <class T1, class T2>
0496 struct is_class_or_union< ::boost::container::dtl::pair<T1, T2> >
0497 //This specialization is needed to avoid instantiation of pair in
0498 //is_class, and allow recursive maps.
0499 {
0500    BOOST_STATIC_CONSTEXPR bool value = true;
0501 };
0502 
0503 template <class T1, class T2>
0504 struct is_class_or_union< std::pair<T1, T2> >
0505 //This specialization is needed to avoid instantiation of pair in
0506 //is_class, and allow recursive maps.
0507 {
0508    BOOST_STATIC_CONSTEXPR bool value = true;
0509 };
0510 
0511 template<class T>
0512 struct is_union;
0513 
0514 template <class T1, class T2>
0515 struct is_union< ::boost::container::dtl::pair<T1, T2> >
0516 //This specialization is needed to avoid instantiation of pair in
0517 //is_class, and allow recursive maps.
0518 {
0519    BOOST_STATIC_CONSTEXPR bool value = false;
0520 };
0521 
0522 template <class T1, class T2>
0523 struct is_union< std::pair<T1, T2> >
0524 //This specialization is needed to avoid instantiation of pair in
0525 //is_class, and allow recursive maps.
0526 {
0527    BOOST_STATIC_CONSTEXPR bool value = false;
0528 };
0529 
0530 template<class T>
0531 struct is_class;
0532 
0533 template <class T1, class T2>
0534 struct is_class< ::boost::container::dtl::pair<T1, T2> >
0535 //This specialization is needed to avoid instantiation of pair in
0536 //is_class, and allow recursive maps.
0537 {
0538    BOOST_STATIC_CONSTEXPR bool value = true;
0539 };
0540 
0541 template <class T1, class T2>
0542 struct is_class< std::pair<T1, T2> >
0543 //This specialization is needed to avoid instantiation of pair in
0544 //is_class, and allow recursive maps.
0545 {
0546    BOOST_STATIC_CONSTEXPR bool value = true;
0547 };
0548 
0549 
0550 //Triviality of pair
0551 template<class T>
0552 struct is_trivially_copy_constructible;
0553 
0554 template<class A, class B>
0555 struct is_trivially_copy_assignable
0556    <boost::container::dtl::pair<A,B> >
0557 {
0558    BOOST_STATIC_CONSTEXPR bool value = false ;
0559 };
0560 
0561 template<class T>
0562 struct is_trivially_move_constructible;
0563 
0564 template<class A, class B>
0565 struct is_trivially_move_assignable
0566    <boost::container::dtl::pair<A,B> >
0567 {
0568    BOOST_STATIC_CONSTEXPR bool value = false;
0569 };
0570 
0571 template<class T>
0572 struct is_trivially_copy_assignable;
0573 
0574 template<class A, class B>
0575 struct is_trivially_copy_constructible<boost::container::dtl::pair<A,B> >
0576 {
0577    BOOST_STATIC_CONSTEXPR bool value = false;
0578 };
0579 
0580 template<class T>
0581 struct is_trivially_move_assignable;
0582 
0583 template<class A, class B>
0584 struct is_trivially_move_constructible<boost::container::dtl::pair<A,B> >
0585 {
0586    BOOST_STATIC_CONSTEXPR bool value = false;
0587 };
0588 
0589 template<class T>
0590 struct is_trivially_destructible;
0591 
0592 template<class A, class B>
0593 struct is_trivially_destructible<boost::container::dtl::pair<A,B> >
0594 {
0595    BOOST_STATIC_CONSTEXPR bool value = boost::move_detail::is_trivially_destructible<A>::value &&
0596                              boost::move_detail::is_trivially_destructible<B>::value ;
0597 };
0598 
0599 
0600 }  //namespace move_detail{
0601 
0602 }  //namespace boost {
0603 
0604 #include <boost/container/detail/config_end.hpp>
0605 
0606 #endif   //#ifndef BOOST_CONTAINER_DETAIL_PAIR_HPP