]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/container/slist.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / container / slist.hpp
index 3a1d66bb6d3d209af411f9ab8b6798351435232a..d721e4f71c0a6a31225439187af62e7ac5663323 100644 (file)
@@ -34,6 +34,7 @@
 #include <boost/container/detail/mpl.hpp>
 #include <boost/container/detail/node_alloc_holder.hpp>
 #include <boost/container/detail/type_traits.hpp>
+#include <boost/container/detail/value_functors.hpp>
 // intrusive
 #include <boost/intrusive/pointer_traits.hpp>
 #include <boost/intrusive/slist.hpp>
@@ -61,13 +62,13 @@ namespace container {
 template <class T, class Allocator>
 class slist;
 
-namespace container_detail {
+namespace dtl {
 
 template<class VoidPointer>
 struct slist_hook
 {
-   typedef typename container_detail::bi::make_slist_base_hook
-      <container_detail::bi::void_pointer<VoidPointer>, container_detail::bi::link_mode<container_detail::bi::normal_link> >::type type;
+   typedef typename dtl::bi::make_slist_base_hook
+      <dtl::bi::void_pointer<VoidPointer>, dtl::bi::link_mode<dtl::bi::normal_link> >::type type;
 };
 
 template <class T, class VoidPointer>
@@ -104,20 +105,20 @@ struct intrusive_slist_type
       <typename allocator_traits_type::pointer>::template
          rebind_pointer<void>::type
             void_pointer;
-   typedef typename container_detail::slist_node
+   typedef typename dtl::slist_node
          <value_type, void_pointer>             node_type;
 
-   typedef typename container_detail::bi::make_slist
+   typedef typename dtl::bi::make_slist
       <node_type
-      ,container_detail::bi::base_hook<typename slist_hook<void_pointer>::type>
-      ,container_detail::bi::constant_time_size<true>
-      , container_detail::bi::size_type
+      ,dtl::bi::base_hook<typename slist_hook<void_pointer>::type>
+      ,dtl::bi::constant_time_size<true>
+      , dtl::bi::size_type
          <typename allocator_traits_type::size_type>
       >::type                                   container_type;
    typedef container_type                       type ;
 };
 
-}  //namespace container_detail {
+}  //namespace dtl {
 
 #endif   //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
 
@@ -162,26 +163,26 @@ template <class T, class Allocator = new_allocator<T> >
 template <class T, class Allocator>
 #endif
 class slist
-   : protected container_detail::node_alloc_holder
-      <Allocator, typename container_detail::intrusive_slist_type<Allocator>::type>
+   : protected dtl::node_alloc_holder
+      <Allocator, typename dtl::intrusive_slist_type<Allocator>::type>
 {
    #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
    typedef typename
-      container_detail::intrusive_slist_type<Allocator>::type           Icont;
-   typedef container_detail::node_alloc_holder<Allocator, Icont>        AllocHolder;
+      dtl::intrusive_slist_type<Allocator>::type           Icont;
+   typedef dtl::node_alloc_holder<Allocator, Icont>        AllocHolder;
    typedef typename AllocHolder::NodePtr                    NodePtr;
    typedef typename AllocHolder::NodeAlloc                  NodeAlloc;
    typedef typename AllocHolder::ValAlloc                   ValAlloc;
    typedef typename AllocHolder::Node                       Node;
-   typedef container_detail::allocator_destroyer<NodeAlloc> Destroyer;
+   typedef dtl::allocator_destroyer<NodeAlloc> Destroyer;
    typedef typename AllocHolder::alloc_version              alloc_version;
    typedef boost::container::
       allocator_traits<Allocator>                           allocator_traits_type;
    typedef boost::container::equal_to_value<Allocator>      equal_to_value_type;
 
    BOOST_COPYABLE_AND_MOVABLE(slist)
-   typedef container_detail::iterator_from_iiterator<typename Icont::iterator, false>  iterator_impl;
-   typedef container_detail::iterator_from_iiterator<typename Icont::iterator, true >  const_iterator_impl;
+   typedef dtl::iterator_from_iiterator<typename Icont::iterator, false>  iterator_impl;
+   typedef dtl::iterator_from_iiterator<typename Icont::iterator, true >  const_iterator_impl;
    #endif   //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
 
    public:
@@ -216,7 +217,7 @@ class slist
    //! <b>Throws</b>: If allocator_type's copy constructor throws.
    //!
    //! <b>Complexity</b>: Constant.
-   slist() BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
+   slist() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<Allocator>::value)
       :  AllocHolder()
    {}
 
@@ -357,7 +358,7 @@ class slist
       if (&x != this){
          NodeAlloc &this_alloc     = this->node_alloc();
          const NodeAlloc &x_alloc  = x.node_alloc();
-         container_detail::bool_<allocator_traits_type::
+         dtl::bool_<allocator_traits_type::
             propagate_on_container_copy_assignment::value> flag;
          if(flag && this_alloc != x_alloc){
             this->clear();
@@ -442,7 +443,7 @@ class slist
    template <class InpIt>
    void assign(InpIt first, InpIt last
       #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
-      , typename container_detail::disable_if_convertible<InpIt, size_type>::type * = 0
+      , typename dtl::disable_if_convertible<InpIt, size_type>::type * = 0
       #endif
       )
    {
@@ -846,10 +847,10 @@ class slist
    template <class InpIt>
    iterator insert_after(const_iterator prev_p, InpIt first, InpIt last
       #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
-      , typename container_detail::enable_if_c
-         < !container_detail::is_convertible<InpIt, size_type>::value
-          && (container_detail::is_input_iterator<InpIt>::value
-                || container_detail::is_same<alloc_version, version_1>::value
+      , typename dtl::enable_if_c
+         < !dtl::is_convertible<InpIt, size_type>::value
+          && (dtl::is_input_iterator<InpIt>::value
+                || dtl::is_same<alloc_version, version_1>::value
                )
          >::type * = 0
       #endif
@@ -884,10 +885,10 @@ class slist
    #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
    template <class FwdIt>
    iterator insert_after(const_iterator prev, FwdIt first, FwdIt last
-      , typename container_detail::enable_if_c
-         < !container_detail::is_convertible<FwdIt, size_type>::value
-            && !(container_detail::is_input_iterator<FwdIt>::value
-                || container_detail::is_same<alloc_version, version_1>::value
+      , typename dtl::enable_if_c
+         < !dtl::is_convertible<FwdIt, size_type>::value
+            && !(dtl::is_input_iterator<FwdIt>::value
+                || dtl::is_same<alloc_version, version_1>::value
                )
          >::type * = 0
       )
@@ -1165,7 +1166,7 @@ class slist
    //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
    //!   and iterators to elements that are not removed remain valid.
    void unique()
-   {  this->unique(value_equal());  }
+   {  this->unique(value_equal_t());  }
 
    //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
    //!   elements that satisfy some binary predicate from the list.
@@ -1195,7 +1196,7 @@ class slist
    //! <b>Complexity</b>: This function is linear time: it performs at most
    //!   size() + x.size() - 1 comparisons.
    void merge(slist & x)
-   {  this->merge(x, value_less()); }
+   {  this->merge(x, value_less_t()); }
 
    //! <b>Requires</b>: The lists x and *this must be distinct.
    //!
@@ -1261,7 +1262,7 @@ class slist
    //! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
    //!   is the list's size.
    void sort()
-   {  this->sort(value_less());  }
+   {  this->sort(value_less_t());  }
 
    //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
    //!   The sort is stable, that is, the relative order of equivalent elements is preserved.
@@ -1470,7 +1471,7 @@ class slist
    //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
    //!   list. Iterators of this list and all the references are not invalidated.
    void splice(const_iterator p, slist& x, const_iterator i) BOOST_NOEXCEPT_OR_NOTHROW
-   {  this->splice_after(this->previous(p), x, this->previous(i));  }
+   {  this->splice_after(this->previous(p), x, x.previous(i));  }
 
    //! <b>Requires</b>: p must point to an element contained
    //!   by this list. i must point to an element contained in list x.
@@ -1504,7 +1505,7 @@ class slist
    //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
    //!   list. Iterators of this list and all the references are not invalidated.
    void splice(const_iterator p, slist& x, const_iterator first, const_iterator last) BOOST_NOEXCEPT_OR_NOTHROW
-   {  this->splice_after(this->previous(p), x, this->previous(first), this->previous(last));  }
+   {  this->splice_after(this->previous(p), x, x.previous(first), x.previous(last));  }
 
    //! <b>Requires</b>: p must point to an element contained
    //!   by this list. first and last must point to elements contained in list x.
@@ -1625,28 +1626,9 @@ class slist
    };
 
    //Functors for member algorithm defaults
-   struct value_less
-   {
-      bool operator()(const value_type &a, const value_type &b) const
-         {  return a < b;  }
-   };
-
-   struct value_equal
-   {
-      bool operator()(const value_type &a, const value_type &b) const
-         {  return a == b;  }
-   };
+   typedef value_less<value_type>   value_less_t;
+   typedef value_equal<value_type>  value_equal_t;
 
-   struct value_equal_to_this
-   {
-      explicit value_equal_to_this(const value_type &ref)
-         : m_ref(ref){}
-
-      bool operator()(const value_type &val) const
-         {  return m_ref == val;  }
-
-      const value_type &m_ref;
-   };
    #endif   //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
 };