Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:13

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