Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:39

0001 /////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga  2013-2014
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/intrusive for documentation.
0010 //
0011 /////////////////////////////////////////////////////////////////////////////
0012 #ifndef BOOST_INTRUSIVE_BS_SET_HPP
0013 #define BOOST_INTRUSIVE_BS_SET_HPP
0014 
0015 #include <boost/intrusive/detail/config_begin.hpp>
0016 #include <boost/intrusive/intrusive_fwd.hpp>
0017 #include <boost/intrusive/detail/mpl.hpp>
0018 #include <boost/intrusive/bstree.hpp>
0019 #include <boost/move/utility_core.hpp>
0020 #include <boost/static_assert.hpp>
0021 
0022 #if defined(BOOST_HAS_PRAGMA_ONCE)
0023 #  pragma once
0024 #endif
0025 
0026 #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
0027 template<class ValueTraits, class VoidOrKeyOfValue, class Compare, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
0028 class bs_multiset_impl;
0029 #endif
0030 
0031 namespace boost {
0032 namespace intrusive {
0033 
0034 //! The class template bs_set is an intrusive container, that mimics most of
0035 //! the interface of std::set as described in the C++ standard.
0036 //!
0037 //! The template parameter \c T is the type to be managed by the container.
0038 //! The user can specify additional options and if no options are provided
0039 //! default options are used.
0040 //!
0041 //! The container supports the following options:
0042 //! \c base_hook<>/member_hook<>/value_traits<>,
0043 //! \c constant_time_size<>, \c size_type<> and
0044 //! \c compare<>.
0045 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
0046 template<class T, class ...Options>
0047 #else
0048 template<class ValueTraits, class VoidOrKeyOfValue, class Compare, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
0049 #endif
0050 class bs_set_impl
0051 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0052    : public bstree_impl<ValueTraits, VoidOrKeyOfValue, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>
0053 #endif
0054 {
0055    /// @cond
0056    typedef bstree_impl<ValueTraits, VoidOrKeyOfValue, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder> tree_type;
0057    BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_set_impl)
0058 
0059    typedef tree_type implementation_defined;
0060    /// @endcond
0061 
0062    public:
0063    typedef typename implementation_defined::value_type               value_type;
0064    typedef typename implementation_defined::key_type                 key_type;
0065    typedef typename implementation_defined::value_traits             value_traits;
0066    typedef typename implementation_defined::pointer                  pointer;
0067    typedef typename implementation_defined::const_pointer            const_pointer;
0068    typedef typename implementation_defined::reference                reference;
0069    typedef typename implementation_defined::const_reference          const_reference;
0070    typedef typename implementation_defined::difference_type          difference_type;
0071    typedef typename implementation_defined::size_type                size_type;
0072    typedef typename implementation_defined::value_compare            value_compare;
0073    typedef typename implementation_defined::key_compare              key_compare;
0074    typedef typename implementation_defined::iterator                 iterator;
0075    typedef typename implementation_defined::const_iterator           const_iterator;
0076    typedef typename implementation_defined::reverse_iterator         reverse_iterator;
0077    typedef typename implementation_defined::const_reverse_iterator   const_reverse_iterator;
0078    typedef typename implementation_defined::insert_commit_data       insert_commit_data;
0079    typedef typename implementation_defined::node_traits              node_traits;
0080    typedef typename implementation_defined::node                     node;
0081    typedef typename implementation_defined::node_ptr                 node_ptr;
0082    typedef typename implementation_defined::const_node_ptr           const_node_ptr;
0083    typedef typename implementation_defined::node_algorithms          node_algorithms;
0084 
0085    static const bool constant_time_size = tree_type::constant_time_size;
0086 
0087    public:
0088    //! @copydoc ::boost::intrusive::bstree::bstree()
0089    bs_set_impl()
0090       :  tree_type()
0091    {}
0092 
0093    //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
0094    explicit bs_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
0095       :  tree_type(cmp, v_traits)
0096    {}
0097 
0098    //! @copydoc ::boost::intrusive::bstree::bstree(bool,Iterator,Iterator,const key_compare &,const value_traits &)
0099    template<class Iterator>
0100    bs_set_impl( Iterator b, Iterator e
0101            , const key_compare &cmp = key_compare()
0102            , const value_traits &v_traits = value_traits())
0103       : tree_type(true, b, e, cmp, v_traits)
0104    {}
0105 
0106    //! @copydoc ::boost::intrusive::bstree::bstree(bstree &&)
0107    bs_set_impl(BOOST_RV_REF(bs_set_impl) x)
0108       :  tree_type(BOOST_MOVE_BASE(tree_type, x))
0109    {}
0110 
0111    //! @copydoc ::boost::intrusive::bstree::operator=(bstree &&)
0112    bs_set_impl& operator=(BOOST_RV_REF(bs_set_impl) x)
0113    {  return static_cast<bs_set_impl&>(tree_type::operator=(BOOST_MOVE_BASE(tree_type, x))); }
0114 
0115    #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0116    //! @copydoc ::boost::intrusive::bstree::~bstree()
0117    ~bs_set_impl();
0118 
0119    //! @copydoc ::boost::intrusive::bstree::begin()
0120    iterator begin() BOOST_NOEXCEPT;
0121 
0122    //! @copydoc ::boost::intrusive::bstree::begin()const
0123    const_iterator begin() const BOOST_NOEXCEPT;
0124 
0125    //! @copydoc ::boost::intrusive::bstree::cbegin()const
0126    const_iterator cbegin() const BOOST_NOEXCEPT;
0127 
0128    //! @copydoc ::boost::intrusive::bstree::end()
0129    iterator end() BOOST_NOEXCEPT;
0130 
0131    //! @copydoc ::boost::intrusive::bstree::end()const
0132    const_iterator end() const BOOST_NOEXCEPT;
0133 
0134    //! @copydoc ::boost::intrusive::bstree::cend()const
0135    const_iterator cend() const BOOST_NOEXCEPT;
0136 
0137    //! @copydoc ::boost::intrusive::bstree::rbegin()
0138    reverse_iterator rbegin() BOOST_NOEXCEPT;
0139 
0140    //! @copydoc ::boost::intrusive::bstree::rbegin()const
0141    const_reverse_iterator rbegin() const BOOST_NOEXCEPT;
0142 
0143    //! @copydoc ::boost::intrusive::bstree::crbegin()const
0144    const_reverse_iterator crbegin() const BOOST_NOEXCEPT;
0145 
0146    //! @copydoc ::boost::intrusive::bstree::rend()
0147    reverse_iterator rend() BOOST_NOEXCEPT;
0148 
0149    //! @copydoc ::boost::intrusive::bstree::rend()const
0150    const_reverse_iterator rend() const BOOST_NOEXCEPT;
0151 
0152    //! @copydoc ::boost::intrusive::bstree::crend()const
0153    const_reverse_iterator crend() const BOOST_NOEXCEPT;
0154 
0155    //! @copydoc ::boost::intrusive::bstree::root()
0156    iterator root() BOOST_NOEXCEPT;
0157 
0158    //! @copydoc ::boost::intrusive::bstree::root()const
0159    const_iterator root() const BOOST_NOEXCEPT;
0160 
0161    //! @copydoc ::boost::intrusive::bstree::croot()const
0162    const_iterator croot() const BOOST_NOEXCEPT;
0163 
0164    //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator)
0165    static bs_set_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT;
0166 
0167    //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator)
0168    static const bs_set_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT;
0169 
0170    //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator)
0171    static bs_set_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT;
0172 
0173    //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator)
0174    static const bs_set_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT;
0175 
0176    //! @copydoc ::boost::intrusive::bstree::key_comp()const
0177    key_compare key_comp() const;
0178 
0179    //! @copydoc ::boost::intrusive::bstree::value_comp()const
0180    value_compare value_comp() const;
0181 
0182    //! @copydoc ::boost::intrusive::bstree::empty()const
0183    bool empty() const BOOST_NOEXCEPT;
0184 
0185    //! @copydoc ::boost::intrusive::bstree::size()const
0186    size_type size() const BOOST_NOEXCEPT;
0187 
0188    //! @copydoc ::boost::intrusive::bstree::swap
0189    void swap(bs_set_impl& other);
0190 
0191    //! @copydoc ::boost::intrusive::bstree::clone_from(const bstree&,Cloner,Disposer)
0192    template <class Cloner, class Disposer>
0193    void clone_from(const bs_set_impl &src, Cloner cloner, Disposer disposer);
0194 
0195    #else
0196 
0197    using tree_type::clone_from;
0198 
0199    #endif   //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0200 
0201    //! @copydoc ::boost::intrusive::bstree::clone_from(bstree&&,Cloner,Disposer)
0202    template <class Cloner, class Disposer>
0203    void clone_from(BOOST_RV_REF(bs_set_impl) src, Cloner cloner, Disposer disposer)
0204    {  tree_type::clone_from(BOOST_MOVE_BASE(tree_type, src), cloner, disposer);  }
0205 
0206    //! @copydoc ::boost::intrusive::bstree::insert_unique(reference)
0207    std::pair<iterator, bool> insert(reference value)
0208    {  return tree_type::insert_unique(value);  }
0209 
0210    //! @copydoc ::boost::intrusive::bstree::insert_unique(const_iterator,reference)
0211    iterator insert(const_iterator hint, reference value)
0212    {  return tree_type::insert_unique(hint, value);  }
0213 
0214    //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&)
0215    std::pair<iterator, bool> insert_check
0216       (const key_type &key, insert_commit_data &commit_data)
0217    {  return tree_type::insert_unique_check(key, commit_data); }
0218 
0219    //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&)
0220    std::pair<iterator, bool> insert_check
0221       (const_iterator hint, const key_type &key
0222       ,insert_commit_data &commit_data)
0223    {  return tree_type::insert_unique_check(hint, key, commit_data); }
0224 
0225    //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
0226    template<class KeyType, class KeyTypeKeyCompare>
0227    std::pair<iterator, bool> insert_check
0228       (const KeyType &key, KeyTypeKeyCompare comp, insert_commit_data &commit_data)
0229    {  return tree_type::insert_unique_check(key, comp, commit_data); }
0230 
0231    //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
0232    template<class KeyType, class KeyTypeKeyCompare>
0233    std::pair<iterator, bool> insert_check
0234       (const_iterator hint, const KeyType &key
0235       ,KeyTypeKeyCompare comp, insert_commit_data &commit_data)
0236    {  return tree_type::insert_unique_check(hint, key, comp, commit_data); }
0237 
0238    //! @copydoc ::boost::intrusive::bstree::insert_unique(Iterator,Iterator)
0239    template<class Iterator>
0240    void insert(Iterator b, Iterator e)
0241    {  tree_type::insert_unique(b, e);  }
0242 
0243    //! @copydoc ::boost::intrusive::bstree::insert_unique_commit
0244    iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT
0245    {  return tree_type::insert_unique_commit(value, commit_data);  }
0246 
0247    #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0248    //! @copydoc ::boost::intrusive::bstree::insert_before
0249    iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT;
0250 
0251    //! @copydoc ::boost::intrusive::bstree::push_back
0252    void push_back(reference value) BOOST_NOEXCEPT;
0253 
0254    //! @copydoc ::boost::intrusive::bstree::push_front
0255    void push_front(reference value) BOOST_NOEXCEPT;
0256 
0257    //! @copydoc ::boost::intrusive::bstree::erase(const_iterator)
0258    iterator erase(const_iterator i) BOOST_NOEXCEPT;
0259 
0260    //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator)
0261    iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT;
0262 
0263    //! @copydoc ::boost::intrusive::bstree::erase(const key_type &)
0264    size_type erase(const key_type &key);
0265 
0266    //! @copydoc ::boost::intrusive::bstree::erase(const KeyType&,KeyTypeKeyCompare)
0267    template<class KeyType, class KeyTypeKeyCompare>
0268    size_type erase(const KeyType& key, KeyTypeKeyCompare comp);
0269 
0270    //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer)
0271    template<class Disposer>
0272    iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT;
0273 
0274    //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer)
0275    template<class Disposer>
0276    iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT;
0277 
0278    //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer)
0279    template<class Disposer>
0280    size_type erase_and_dispose(const key_type &key, Disposer disposer);
0281 
0282    //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const KeyType&,KeyTypeKeyCompare,Disposer)
0283    template<class KeyType, class KeyTypeKeyCompare, class Disposer>
0284    size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer);
0285 
0286    //! @copydoc ::boost::intrusive::bstree::clear
0287    void clear() BOOST_NOEXCEPT;
0288 
0289    //! @copydoc ::boost::intrusive::bstree::clear_and_dispose
0290    template<class Disposer>
0291    void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT;
0292 
0293    #endif   //   #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0294 
0295    //! @copydoc ::boost::intrusive::bstree::count(const key_type &)const
0296    size_type count(const key_type &key) const
0297    {  return static_cast<size_type>(this->tree_type::find(key) != this->tree_type::cend()); }
0298 
0299    //! @copydoc ::boost::intrusive::bstree::count(const KeyType&,KeyTypeKeyCompare)const
0300    template<class KeyType, class KeyTypeKeyCompare>
0301    size_type count(const KeyType& key, KeyTypeKeyCompare comp) const
0302    {  return static_cast<size_type>(this->tree_type::find(key, comp) != this->tree_type::cend()); }
0303 
0304    #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0305 
0306    //! @copydoc ::boost::intrusive::bstree::lower_bound(const key_type &)
0307    iterator lower_bound(const key_type &);
0308 
0309    //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyTypeKeyCompare)
0310    template<class KeyType, class KeyTypeKeyCompare>
0311    iterator lower_bound(const KeyType& key, KeyTypeKeyCompare comp);
0312 
0313    //! @copydoc ::boost::intrusive::bstree::lower_bound(const key_type &)const
0314    const_iterator lower_bound(const key_type &key) const;
0315 
0316    //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyTypeKeyCompare)const
0317    template<class KeyType, class KeyTypeKeyCompare>
0318    const_iterator lower_bound(const KeyType& key, KeyTypeKeyCompare comp) const;
0319 
0320    //! @copydoc ::boost::intrusive::bstree::upper_bound(const key_type &)
0321    iterator upper_bound(const key_type &key);
0322 
0323    //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyTypeKeyCompare)
0324    template<class KeyType, class KeyTypeKeyCompare>
0325    iterator upper_bound(const KeyType& key, KeyTypeKeyCompare comp);
0326 
0327    //! @copydoc ::boost::intrusive::bstree::upper_bound(const key_type &)const
0328    const_iterator upper_bound(const key_type &key) const;
0329 
0330    //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyTypeKeyCompare)const
0331    template<class KeyType, class KeyTypeKeyCompare>
0332    const_iterator upper_bound(const KeyType& key, KeyTypeKeyCompare comp) const;
0333 
0334    //! @copydoc ::boost::intrusive::bstree::find(const key_type &)
0335    iterator find(const key_type &key);
0336 
0337    //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyTypeKeyCompare)
0338    template<class KeyType, class KeyTypeKeyCompare>
0339    iterator find(const KeyType& key, KeyTypeKeyCompare comp);
0340 
0341    //! @copydoc ::boost::intrusive::bstree::find(const key_type &)const
0342    const_iterator find(const key_type &key) const;
0343 
0344    //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyTypeKeyCompare)const
0345    template<class KeyType, class KeyTypeKeyCompare>
0346    const_iterator find(const KeyType& key, KeyTypeKeyCompare comp) const;
0347 
0348    #endif   //   #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0349 
0350    //! @copydoc ::boost::intrusive::bstree::equal_range(const key_type &)
0351    std::pair<iterator,iterator> equal_range(const key_type &key)
0352    {  return this->tree_type::lower_bound_range(key); }
0353 
0354    //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyTypeKeyCompare)
0355    template<class KeyType, class KeyTypeKeyCompare>
0356    std::pair<iterator,iterator> equal_range(const KeyType& key, KeyTypeKeyCompare comp)
0357    {  return this->tree_type::equal_range(key, comp); }
0358 
0359    //! @copydoc ::boost::intrusive::bstree::equal_range(const key_type &)const
0360    std::pair<const_iterator, const_iterator>
0361       equal_range(const key_type &key) const
0362    {  return this->tree_type::lower_bound_range(key); }
0363 
0364    //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyTypeKeyCompare)const
0365    template<class KeyType, class KeyTypeKeyCompare>
0366    std::pair<const_iterator, const_iterator>
0367       equal_range(const KeyType& key, KeyTypeKeyCompare comp) const
0368    {  return this->tree_type::equal_range(key, comp); }
0369 
0370    #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0371 
0372    //! @copydoc ::boost::intrusive::bstree::bounded_range(const key_type&,const key_type&,bool,bool)
0373    std::pair<iterator,iterator> bounded_range
0374       (const key_type& lower_key, const key_type& upper_key, bool left_closed, bool right_closed);
0375 
0376    //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyTypeKeyCompare,bool,bool)
0377    template<class KeyType, class KeyTypeKeyCompare>
0378    std::pair<iterator,iterator> bounded_range
0379       (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed);
0380 
0381    //! @copydoc ::boost::intrusive::bstree::bounded_range(const key_type&,const key_type&,bool,bool)const
0382    std::pair<const_iterator, const_iterator>
0383       bounded_range(const key_type& lower_key, const key_type& upper_key, bool left_closed, bool right_closed) const;
0384 
0385    //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyTypeKeyCompare,bool,bool)const
0386    template<class KeyType, class KeyTypeKeyCompare>
0387    std::pair<const_iterator, const_iterator> bounded_range
0388          (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const;
0389 
0390    //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference)
0391    static iterator s_iterator_to(reference value) BOOST_NOEXCEPT;
0392 
0393    //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference)
0394    static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT;
0395 
0396    //! @copydoc ::boost::intrusive::bstree::iterator_to(reference)
0397    iterator iterator_to(reference value) BOOST_NOEXCEPT;
0398 
0399    //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const
0400    const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT;
0401 
0402    //! @copydoc ::boost::intrusive::bstree::init_node(reference)
0403    static void init_node(reference value) BOOST_NOEXCEPT;
0404 
0405    //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance
0406    pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT;
0407 
0408    //! @copydoc ::boost::intrusive::bstree::replace_node
0409    void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT;
0410 
0411    //! @copydoc ::boost::intrusive::bstree::remove_node
0412    void remove_node(reference value) BOOST_NOEXCEPT;
0413 
0414    //! @copydoc ::boost::intrusive::bstree::merge_unique
0415    template<class ...Options2>
0416    void merge(bs_set<T, Options2...> &source);
0417 
0418    //! @copydoc ::boost::intrusive::bstree::merge_unique
0419    template<class ...Options2>
0420    void merge(bs_multiset<T, Options2...> &source);
0421 
0422    #else
0423 
0424    template<class Compare2>
0425    void merge(bs_set_impl<ValueTraits, VoidOrKeyOfValue, Compare2, SizeType, ConstantTimeSize, HeaderHolder> &source)
0426    {  return tree_type::merge_unique(source);  }
0427 
0428 
0429    template<class Compare2>
0430    void merge(bs_multiset_impl<ValueTraits, VoidOrKeyOfValue, Compare2, SizeType, ConstantTimeSize, HeaderHolder> &source)
0431    {  return tree_type::merge_unique(source);  }
0432 
0433    #endif   //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0434 };
0435 
0436 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
0437 
0438 template<class T, class ...Options>
0439 bool operator!= (const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
0440 
0441 template<class T, class ...Options>
0442 bool operator>(const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
0443 
0444 template<class T, class ...Options>
0445 bool operator<=(const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
0446 
0447 template<class T, class ...Options>
0448 bool operator>=(const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
0449 
0450 template<class T, class ...Options>
0451 void swap(bs_set_impl<T, Options...> &x, bs_set_impl<T, Options...> &y);
0452 
0453 #endif   //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
0454 
0455 //! Helper metafunction to define a \c bs_set that yields to the same type when the
0456 //! same options (either explicitly or implicitly) are used.
0457 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0458 template<class T, class ...Options>
0459 #else
0460 template<class T, class O1 = void, class O2 = void
0461                 , class O3 = void, class O4 = void
0462                 , class O5 = void, class O6 = void>
0463 #endif
0464 struct make_bs_set
0465 {
0466    /// @cond
0467    typedef typename pack_options
0468       < bstree_defaults,
0469       #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0470       O1, O2, O3, O4, O5, O6
0471       #else
0472       Options...
0473       #endif
0474       >::type packed_options;
0475 
0476    typedef typename detail::get_value_traits
0477       <T, typename packed_options::proto_value_traits>::type value_traits;
0478 
0479    typedef bs_set_impl
0480          < value_traits
0481          , typename packed_options::key_of_value
0482          , typename packed_options::compare
0483          , typename packed_options::size_type
0484          , packed_options::constant_time_size
0485          , typename packed_options::header_holder_type
0486          > implementation_defined;
0487    /// @endcond
0488    typedef implementation_defined type;
0489 };
0490 
0491 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0492 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0493 template<class T, class O1, class O2, class O3, class O4, class O5, class O6>
0494 #else
0495 template<class T, class ...Options>
0496 #endif
0497 class bs_set
0498    :  public make_bs_set<T,
0499    #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0500    O1, O2, O3, O4, O5, O6
0501    #else
0502    Options...
0503    #endif
0504    >::type
0505 {
0506    typedef typename make_bs_set
0507       <T,
0508       #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0509       O1, O2, O3, O4, O5, O6
0510       #else
0511       Options...
0512       #endif
0513       >::type   Base;
0514 
0515    BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_set)
0516    public:
0517    typedef typename Base::value_traits       value_traits;
0518    typedef typename Base::key_compare        key_compare;
0519    typedef typename Base::iterator           iterator;
0520    typedef typename Base::const_iterator     const_iterator;
0521 
0522    //Assert if passed value traits are compatible with the type
0523    BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
0524 
0525    BOOST_INTRUSIVE_FORCEINLINE bs_set()
0526       :  Base()
0527    {}
0528 
0529    BOOST_INTRUSIVE_FORCEINLINE explicit bs_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
0530       :  Base(cmp, v_traits)
0531    {}
0532 
0533    template<class Iterator>
0534    BOOST_INTRUSIVE_FORCEINLINE bs_set( Iterator b, Iterator e
0535       , const key_compare &cmp = key_compare()
0536       , const value_traits &v_traits = value_traits())
0537       :  Base(b, e, cmp, v_traits)
0538    {}
0539 
0540    BOOST_INTRUSIVE_FORCEINLINE bs_set(BOOST_RV_REF(bs_set) x)
0541       :  Base(BOOST_MOVE_BASE(Base, x))
0542    {}
0543 
0544    BOOST_INTRUSIVE_FORCEINLINE bs_set& operator=(BOOST_RV_REF(bs_set) x)
0545    {  return static_cast<bs_set &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x)));  }
0546 
0547    template <class Cloner, class Disposer>
0548    BOOST_INTRUSIVE_FORCEINLINE void clone_from(const bs_set &src, Cloner cloner, Disposer disposer)
0549    {  Base::clone_from(src, cloner, disposer);  }
0550 
0551    template <class Cloner, class Disposer>
0552    BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(bs_set) src, Cloner cloner, Disposer disposer)
0553    {  Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer);  }
0554 
0555    BOOST_INTRUSIVE_FORCEINLINE static bs_set &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT
0556    {  return static_cast<bs_set &>(Base::container_from_end_iterator(end_iterator));   }
0557 
0558    BOOST_INTRUSIVE_FORCEINLINE static const bs_set &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT
0559    {  return static_cast<const bs_set &>(Base::container_from_end_iterator(end_iterator));   }
0560 
0561    BOOST_INTRUSIVE_FORCEINLINE static bs_set &container_from_iterator(iterator it) BOOST_NOEXCEPT
0562    {  return static_cast<bs_set &>(Base::container_from_iterator(it));   }
0563 
0564    BOOST_INTRUSIVE_FORCEINLINE static const bs_set &container_from_iterator(const_iterator it) BOOST_NOEXCEPT
0565    {  return static_cast<const bs_set &>(Base::container_from_iterator(it));   }
0566 };
0567 
0568 #endif
0569 
0570 //! The class template bs_multiset is an intrusive container, that mimics most of
0571 //! the interface of std::multiset as described in the C++ standard.
0572 //!
0573 //! The template parameter \c T is the type to be managed by the container.
0574 //! The user can specify additional options and if no options are provided
0575 //! default options are used.
0576 //!
0577 //! The container supports the following options:
0578 //! \c base_hook<>/member_hook<>/value_traits<>,
0579 //! \c constant_time_size<>, \c size_type<> and
0580 //! \c compare<>.
0581 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
0582 template<class T, class ...Options>
0583 #else
0584 template<class ValueTraits, class VoidOrKeyOfValue, class Compare, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
0585 #endif
0586 class bs_multiset_impl
0587 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0588    : public bstree_impl<ValueTraits, VoidOrKeyOfValue, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>
0589 #endif
0590 {
0591    /// @cond
0592    typedef bstree_impl<ValueTraits, VoidOrKeyOfValue, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder> tree_type;
0593 
0594    BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_multiset_impl)
0595    typedef tree_type implementation_defined;
0596    /// @endcond
0597 
0598    public:
0599    typedef typename implementation_defined::value_type               value_type;
0600    typedef typename implementation_defined::key_type                 key_type;
0601    typedef typename implementation_defined::value_traits             value_traits;
0602    typedef typename implementation_defined::pointer                  pointer;
0603    typedef typename implementation_defined::const_pointer            const_pointer;
0604    typedef typename implementation_defined::reference                reference;
0605    typedef typename implementation_defined::const_reference          const_reference;
0606    typedef typename implementation_defined::difference_type          difference_type;
0607    typedef typename implementation_defined::size_type                size_type;
0608    typedef typename implementation_defined::value_compare            value_compare;
0609    typedef typename implementation_defined::key_compare              key_compare;
0610    typedef typename implementation_defined::iterator                 iterator;
0611    typedef typename implementation_defined::const_iterator           const_iterator;
0612    typedef typename implementation_defined::reverse_iterator         reverse_iterator;
0613    typedef typename implementation_defined::const_reverse_iterator   const_reverse_iterator;
0614    typedef typename implementation_defined::insert_commit_data       insert_commit_data;
0615    typedef typename implementation_defined::node_traits              node_traits;
0616    typedef typename implementation_defined::node                     node;
0617    typedef typename implementation_defined::node_ptr                 node_ptr;
0618    typedef typename implementation_defined::const_node_ptr           const_node_ptr;
0619    typedef typename implementation_defined::node_algorithms          node_algorithms;
0620 
0621    static const bool constant_time_size = tree_type::constant_time_size;
0622 
0623    public:
0624    //! @copydoc ::boost::intrusive::bstree::bstree()
0625    bs_multiset_impl()
0626       :  tree_type()
0627    {}
0628 
0629    //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
0630    explicit bs_multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
0631       :  tree_type(cmp, v_traits)
0632    {}
0633 
0634    //! @copydoc ::boost::intrusive::bstree::bstree(bool,Iterator,Iterator,const key_compare &,const value_traits &)
0635    template<class Iterator>
0636    bs_multiset_impl( Iterator b, Iterator e
0637                 , const key_compare &cmp = key_compare()
0638                 , const value_traits &v_traits = value_traits())
0639       : tree_type(false, b, e, cmp, v_traits)
0640    {}
0641 
0642    //! @copydoc ::boost::intrusive::bstree::bstree(bstree &&)
0643    bs_multiset_impl(BOOST_RV_REF(bs_multiset_impl) x)
0644       :  tree_type(BOOST_MOVE_BASE(tree_type, x))
0645    {}
0646 
0647    //! @copydoc ::boost::intrusive::bstree::operator=(bstree &&)
0648    bs_multiset_impl& operator=(BOOST_RV_REF(bs_multiset_impl) x)
0649    {  return static_cast<bs_multiset_impl&>(tree_type::operator=(BOOST_MOVE_BASE(tree_type, x))); }
0650 
0651    #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0652    //! @copydoc ::boost::intrusive::bstree::~bstree()
0653    ~bs_multiset_impl();
0654 
0655    //! @copydoc ::boost::intrusive::bstree::begin()
0656    iterator begin() BOOST_NOEXCEPT;
0657 
0658    //! @copydoc ::boost::intrusive::bstree::begin()const
0659    const_iterator begin() const BOOST_NOEXCEPT;
0660 
0661    //! @copydoc ::boost::intrusive::bstree::cbegin()const
0662    const_iterator cbegin() const BOOST_NOEXCEPT;
0663 
0664    //! @copydoc ::boost::intrusive::bstree::end()
0665    iterator end() BOOST_NOEXCEPT;
0666 
0667    //! @copydoc ::boost::intrusive::bstree::end()const
0668    const_iterator end() const BOOST_NOEXCEPT;
0669 
0670    //! @copydoc ::boost::intrusive::bstree::cend()const
0671    const_iterator cend() const BOOST_NOEXCEPT;
0672 
0673    //! @copydoc ::boost::intrusive::bstree::rbegin()
0674    reverse_iterator rbegin() BOOST_NOEXCEPT;
0675 
0676    //! @copydoc ::boost::intrusive::bstree::rbegin()const
0677    const_reverse_iterator rbegin() const BOOST_NOEXCEPT;
0678 
0679    //! @copydoc ::boost::intrusive::bstree::crbegin()const
0680    const_reverse_iterator crbegin() const BOOST_NOEXCEPT;
0681 
0682    //! @copydoc ::boost::intrusive::bstree::rend()
0683    reverse_iterator rend() BOOST_NOEXCEPT;
0684 
0685    //! @copydoc ::boost::intrusive::bstree::rend()const
0686    const_reverse_iterator rend() const BOOST_NOEXCEPT;
0687 
0688    //! @copydoc ::boost::intrusive::bstree::crend()const
0689    const_reverse_iterator crend() const BOOST_NOEXCEPT;
0690 
0691    //! @copydoc ::boost::intrusive::bstree::root()
0692    iterator root() BOOST_NOEXCEPT;
0693 
0694    //! @copydoc ::boost::intrusive::bstree::root()const
0695    const_iterator root() const BOOST_NOEXCEPT;
0696 
0697    //! @copydoc ::boost::intrusive::bstree::croot()const
0698    const_iterator croot() const BOOST_NOEXCEPT;
0699 
0700    //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator)
0701    static bs_multiset_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT;
0702 
0703    //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator)
0704    static const bs_multiset_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT;
0705 
0706    //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator)
0707    static bs_multiset_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT;
0708 
0709    //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator)
0710    static const bs_multiset_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT;
0711 
0712    //! @copydoc ::boost::intrusive::bstree::key_comp()const
0713    key_compare key_comp() const;
0714 
0715    //! @copydoc ::boost::intrusive::bstree::value_comp()const
0716    value_compare value_comp() const;
0717 
0718    //! @copydoc ::boost::intrusive::bstree::empty()const
0719    bool empty() const BOOST_NOEXCEPT;
0720 
0721    //! @copydoc ::boost::intrusive::bstree::size()const
0722    size_type size() const BOOST_NOEXCEPT;
0723 
0724    //! @copydoc ::boost::intrusive::bstree::swap
0725    void swap(bs_multiset_impl& other);
0726 
0727    //! @copydoc ::boost::intrusive::bstree::clone_from(const bstree&,Cloner,Disposer)
0728    template <class Cloner, class Disposer>
0729    void clone_from(const bs_multiset_impl &src, Cloner cloner, Disposer disposer);
0730 
0731    #else
0732 
0733    using tree_type::clone_from;
0734 
0735    #endif   //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0736 
0737    //! @copydoc ::boost::intrusive::bstree::clone_from(bstree&&,Cloner,Disposer)
0738    template <class Cloner, class Disposer>
0739    void clone_from(BOOST_RV_REF(bs_multiset_impl) src, Cloner cloner, Disposer disposer)
0740    {  tree_type::clone_from(BOOST_MOVE_BASE(tree_type, src), cloner, disposer);  }
0741 
0742    //! @copydoc ::boost::intrusive::bstree::insert_equal(reference)
0743    iterator insert(reference value)
0744    {  return tree_type::insert_equal(value);  }
0745 
0746    //! @copydoc ::boost::intrusive::bstree::insert_equal(const_iterator,reference)
0747    iterator insert(const_iterator hint, reference value)
0748    {  return tree_type::insert_equal(hint, value);  }
0749 
0750    //! @copydoc ::boost::intrusive::bstree::insert_equal(Iterator,Iterator)
0751    template<class Iterator>
0752    void insert(Iterator b, Iterator e)
0753    {  tree_type::insert_equal(b, e);  }
0754 
0755    #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0756    //! @copydoc ::boost::intrusive::bstree::insert_before
0757    iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT;
0758 
0759    //! @copydoc ::boost::intrusive::bstree::push_back
0760    void push_back(reference value) BOOST_NOEXCEPT;
0761 
0762    //! @copydoc ::boost::intrusive::bstree::push_front
0763    void push_front(reference value) BOOST_NOEXCEPT;
0764 
0765    //! @copydoc ::boost::intrusive::bstree::erase(const_iterator)
0766    iterator erase(const_iterator i) BOOST_NOEXCEPT;
0767 
0768    //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator)
0769    iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT;
0770 
0771    //! @copydoc ::boost::intrusive::bstree::erase(const key_type &)
0772    size_type erase(const key_type &key);
0773 
0774    //! @copydoc ::boost::intrusive::bstree::erase(const KeyType&,KeyTypeKeyCompare)
0775    template<class KeyType, class KeyTypeKeyCompare>
0776    size_type erase(const KeyType& key, KeyTypeKeyCompare comp);
0777 
0778    //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer)
0779    template<class Disposer>
0780    iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT;
0781 
0782    //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer)
0783    template<class Disposer>
0784    iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT;
0785 
0786    //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer)
0787    template<class Disposer>
0788    size_type erase_and_dispose(const key_type &key, Disposer disposer);
0789 
0790    //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const KeyType&,KeyTypeKeyCompare,Disposer)
0791    template<class KeyType, class KeyTypeKeyCompare, class Disposer>
0792    size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer);
0793 
0794    //! @copydoc ::boost::intrusive::bstree::clear
0795    void clear() BOOST_NOEXCEPT;
0796 
0797    //! @copydoc ::boost::intrusive::bstree::clear_and_dispose
0798    template<class Disposer>
0799    void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT;
0800 
0801    //! @copydoc ::boost::intrusive::bstree::count(const key_type &)const
0802    size_type count(const key_type &key) const;
0803 
0804    //! @copydoc ::boost::intrusive::bstree::count(const KeyType&,KeyTypeKeyCompare)const
0805    template<class KeyType, class KeyTypeKeyCompare>
0806    size_type count(const KeyType& key, KeyTypeKeyCompare comp) const;
0807 
0808    //! @copydoc ::boost::intrusive::bstree::lower_bound(const key_type &)
0809    iterator lower_bound(const key_type &key);
0810 
0811    //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyTypeKeyCompare)
0812    template<class KeyType, class KeyTypeKeyCompare>
0813    iterator lower_bound(const KeyType& key, KeyTypeKeyCompare comp);
0814 
0815    //! @copydoc ::boost::intrusive::bstree::lower_bound(const key_type &)const
0816    const_iterator lower_bound(const key_type &key) const;
0817 
0818    //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyTypeKeyCompare)const
0819    template<class KeyType, class KeyTypeKeyCompare>
0820    const_iterator lower_bound(const KeyType& key, KeyTypeKeyCompare comp) const;
0821 
0822    //! @copydoc ::boost::intrusive::bstree::upper_bound(const key_type &)
0823    iterator upper_bound(const key_type &key);
0824 
0825    //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyTypeKeyCompare)
0826    template<class KeyType, class KeyTypeKeyCompare>
0827    iterator upper_bound(const KeyType& key, KeyTypeKeyCompare comp);
0828 
0829    //! @copydoc ::boost::intrusive::bstree::upper_bound(const key_type &)const
0830    const_iterator upper_bound(const key_type &key) const;
0831 
0832    //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyTypeKeyCompare)const
0833    template<class KeyType, class KeyTypeKeyCompare>
0834    const_iterator upper_bound(const KeyType& key, KeyTypeKeyCompare comp) const;
0835 
0836    //! @copydoc ::boost::intrusive::bstree::find(const key_type &)
0837    iterator find(const key_type &key);
0838 
0839    //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyTypeKeyCompare)
0840    template<class KeyType, class KeyTypeKeyCompare>
0841    iterator find(const KeyType& key, KeyTypeKeyCompare comp);
0842 
0843    //! @copydoc ::boost::intrusive::bstree::find(const key_type &)const
0844    const_iterator find(const key_type &key) const;
0845 
0846    //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyTypeKeyCompare)const
0847    template<class KeyType, class KeyTypeKeyCompare>
0848    const_iterator find(const KeyType& key, KeyTypeKeyCompare comp) const;
0849 
0850    //! @copydoc ::boost::intrusive::bstree::equal_range(const key_type &)
0851    std::pair<iterator,iterator> equal_range(const key_type &key);
0852 
0853    //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyTypeKeyCompare)
0854    template<class KeyType, class KeyTypeKeyCompare>
0855    std::pair<iterator,iterator> equal_range(const KeyType& key, KeyTypeKeyCompare comp);
0856 
0857    //! @copydoc ::boost::intrusive::bstree::equal_range(const key_type &)const
0858    std::pair<const_iterator, const_iterator>
0859       equal_range(const key_type &key) const;
0860 
0861    //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyTypeKeyCompare)const
0862    template<class KeyType, class KeyTypeKeyCompare>
0863    std::pair<const_iterator, const_iterator>
0864       equal_range(const KeyType& key, KeyTypeKeyCompare comp) const;
0865 
0866    //! @copydoc ::boost::intrusive::bstree::bounded_range(const key_type &,const key_type &,bool,bool)
0867    std::pair<iterator,iterator> bounded_range
0868       (const key_type & lower_key, const key_type & upper_key, bool left_closed, bool right_closed);
0869 
0870    //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyTypeKeyCompare,bool,bool)
0871    template<class KeyType, class KeyTypeKeyCompare>
0872    std::pair<iterator,iterator> bounded_range
0873       (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed);
0874 
0875    //! @copydoc ::boost::intrusive::bstree::bounded_range(const key_type &,const key_type &,bool,bool)const
0876    std::pair<const_iterator, const_iterator>
0877       bounded_range(const key_type & lower_key, const key_type & upper_key, bool left_closed, bool right_closed) const;
0878 
0879    //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyTypeKeyCompare,bool,bool)const
0880    template<class KeyType, class KeyTypeKeyCompare>
0881    std::pair<const_iterator, const_iterator> bounded_range
0882          (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const;
0883 
0884    //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference)
0885    static iterator s_iterator_to(reference value) BOOST_NOEXCEPT;
0886 
0887    //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference)
0888    static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT;
0889 
0890    //! @copydoc ::boost::intrusive::bstree::iterator_to(reference)
0891    iterator iterator_to(reference value) BOOST_NOEXCEPT;
0892 
0893    //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const
0894    const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT;
0895 
0896    //! @copydoc ::boost::intrusive::bstree::init_node(reference)
0897    static void init_node(reference value) BOOST_NOEXCEPT;
0898 
0899    //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance
0900    pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT;
0901 
0902    //! @copydoc ::boost::intrusive::bstree::replace_node
0903    void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT;
0904 
0905    //! @copydoc ::boost::intrusive::bstree::remove_node
0906    void remove_node(reference value) BOOST_NOEXCEPT;
0907 
0908    //! @copydoc ::boost::intrusive::bstree::merge_equal
0909    template<class ...Options2>
0910    void merge(bs_multiset<T, Options2...> &source);
0911 
0912    //! @copydoc ::boost::intrusive::bstree::merge_equal
0913    template<class ...Options2>
0914    void merge(bs_set<T, Options2...> &source);
0915 
0916    #else
0917 
0918    template<class Compare2>
0919    void merge(bs_multiset_impl<ValueTraits, VoidOrKeyOfValue, Compare2, SizeType, ConstantTimeSize, HeaderHolder> &source)
0920    {  return tree_type::merge_equal(source);  }
0921 
0922    template<class Compare2>
0923    void merge(bs_set_impl<ValueTraits, VoidOrKeyOfValue, Compare2, SizeType, ConstantTimeSize, HeaderHolder> &source)
0924    {  return tree_type::merge_equal(source);  }
0925 
0926    #endif   //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0927 };
0928 
0929 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
0930 
0931 template<class T, class ...Options>
0932 bool operator!= (const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
0933 
0934 template<class T, class ...Options>
0935 bool operator>(const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
0936 
0937 template<class T, class ...Options>
0938 bool operator<=(const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
0939 
0940 template<class T, class ...Options>
0941 bool operator>=(const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
0942 
0943 template<class T, class ...Options>
0944 void swap(bs_multiset_impl<T, Options...> &x, bs_multiset_impl<T, Options...> &y);
0945 
0946 #endif   //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
0947 
0948 //! Helper metafunction to define a \c bs_multiset that yields to the same type when the
0949 //! same options (either explicitly or implicitly) are used.
0950 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0951 template<class T, class ...Options>
0952 #else
0953 template<class T, class O1 = void, class O2 = void
0954                 , class O3 = void, class O4 = void
0955                 , class O5 = void, class O6 = void>
0956 #endif
0957 struct make_bs_multiset
0958 {
0959    /// @cond
0960    typedef typename pack_options
0961       < bstree_defaults,
0962       #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0963       O1, O2, O3, O4, O5, O6
0964       #else
0965       Options...
0966       #endif
0967       >::type packed_options;
0968 
0969    typedef typename detail::get_value_traits
0970       <T, typename packed_options::proto_value_traits>::type value_traits;
0971 
0972    typedef bs_multiset_impl
0973          < value_traits
0974          , typename packed_options::key_of_value
0975          , typename packed_options::compare
0976          , typename packed_options::size_type
0977          , packed_options::constant_time_size
0978          , typename packed_options::header_holder_type
0979          > implementation_defined;
0980    /// @endcond
0981    typedef implementation_defined type;
0982 };
0983 
0984 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0985 
0986 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0987 template<class T, class O1, class O2, class O3, class O4, class O5, class O6>
0988 #else
0989 template<class T, class ...Options>
0990 #endif
0991 class bs_multiset
0992    :  public make_bs_multiset<T,
0993       #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
0994       O1, O2, O3, O4, O5, O6
0995       #else
0996       Options...
0997       #endif
0998       >::type
0999 {
1000    typedef typename make_bs_multiset<T,
1001       #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
1002       O1, O2, O3, O4, O5, O6
1003       #else
1004       Options...
1005       #endif
1006       >::type   Base;
1007 
1008    BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_multiset)
1009 
1010    public:
1011    typedef typename Base::key_compare        key_compare;
1012    typedef typename Base::value_traits       value_traits;
1013    typedef typename Base::iterator           iterator;
1014    typedef typename Base::const_iterator     const_iterator;
1015 
1016    //Assert if passed value traits are compatible with the type
1017    BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
1018 
1019    BOOST_INTRUSIVE_FORCEINLINE bs_multiset()
1020       :  Base()
1021    {}
1022 
1023    BOOST_INTRUSIVE_FORCEINLINE explicit bs_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
1024       :  Base(cmp, v_traits)
1025    {}
1026 
1027    template<class Iterator>
1028    BOOST_INTRUSIVE_FORCEINLINE bs_multiset( Iterator b, Iterator e
1029            , const key_compare &cmp = key_compare()
1030            , const value_traits &v_traits = value_traits())
1031       :  Base(b, e, cmp, v_traits)
1032    {}
1033 
1034    BOOST_INTRUSIVE_FORCEINLINE bs_multiset(BOOST_RV_REF(bs_multiset) x)
1035       :  Base(BOOST_MOVE_BASE(Base, x))
1036    {}
1037 
1038    BOOST_INTRUSIVE_FORCEINLINE bs_multiset& operator=(BOOST_RV_REF(bs_multiset) x)
1039    {  return static_cast<bs_multiset &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x)));  }
1040 
1041    template <class Cloner, class Disposer>
1042    BOOST_INTRUSIVE_FORCEINLINE void clone_from(const bs_multiset &src, Cloner cloner, Disposer disposer)
1043    {  Base::clone_from(src, cloner, disposer);  }
1044 
1045    template <class Cloner, class Disposer>
1046    BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(bs_multiset) src, Cloner cloner, Disposer disposer)
1047    {  Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer);  }
1048 
1049    BOOST_INTRUSIVE_FORCEINLINE static bs_multiset &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT
1050    {  return static_cast<bs_multiset &>(Base::container_from_end_iterator(end_iterator));   }
1051 
1052    BOOST_INTRUSIVE_FORCEINLINE static const bs_multiset &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT
1053    {  return static_cast<const bs_multiset &>(Base::container_from_end_iterator(end_iterator));   }
1054 
1055    BOOST_INTRUSIVE_FORCEINLINE static bs_multiset &container_from_iterator(iterator it) BOOST_NOEXCEPT
1056    {  return static_cast<bs_multiset &>(Base::container_from_iterator(it));   }
1057 
1058    BOOST_INTRUSIVE_FORCEINLINE static const bs_multiset &container_from_iterator(const_iterator it) BOOST_NOEXCEPT
1059    {  return static_cast<const bs_multiset &>(Base::container_from_iterator(it));   }
1060 };
1061 
1062 #endif
1063 
1064 } //namespace intrusive
1065 } //namespace boost
1066 
1067 #include <boost/intrusive/detail/config_end.hpp>
1068 
1069 #endif //BOOST_INTRUSIVE_BS_SET_HPP