123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068 |
- /////////////////////////////////////////////////////////////////////////////
- //
- // (C) Copyright Ion Gaztanaga 2013-2014
- //
- // Distributed under the Boost Software License, Version 1.0.
- // (See accompanying file LICENSE_1_0.txt or copy at
- // http://www.boost.org/LICENSE_1_0.txt)
- //
- // See http://www.boost.org/libs/intrusive for documentation.
- //
- /////////////////////////////////////////////////////////////////////////////
- #ifndef BOOST_INTRUSIVE_BS_SET_HPP
- #define BOOST_INTRUSIVE_BS_SET_HPP
- #include <boost/intrusive/detail/config_begin.hpp>
- #include <boost/intrusive/intrusive_fwd.hpp>
- #include <boost/intrusive/detail/mpl.hpp>
- #include <boost/intrusive/bstree.hpp>
- #include <boost/move/utility_core.hpp>
- #if defined(BOOST_HAS_PRAGMA_ONCE)
- # pragma once
- #endif
- #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
- template<class ValueTraits, class VoidOrKeyOfValue, class Compare, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
- class bs_multiset_impl;
- #endif
- namespace boost {
- namespace intrusive {
- //! The class template bs_set is an intrusive container, that mimics most of
- //! the interface of std::set as described in the C++ standard.
- //!
- //! The template parameter \c T is the type to be managed by the container.
- //! The user can specify additional options and if no options are provided
- //! default options are used.
- //!
- //! The container supports the following options:
- //! \c base_hook<>/member_hook<>/value_traits<>,
- //! \c constant_time_size<>, \c size_type<> and
- //! \c compare<>.
- #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
- template<class T, class ...Options>
- #else
- template<class ValueTraits, class VoidOrKeyOfValue, class Compare, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
- #endif
- class bs_set_impl
- #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- : public bstree_impl<ValueTraits, VoidOrKeyOfValue, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>
- #endif
- {
- /// @cond
- typedef bstree_impl<ValueTraits, VoidOrKeyOfValue, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder> tree_type;
- BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_set_impl)
- typedef tree_type implementation_defined;
- /// @endcond
- public:
- typedef typename implementation_defined::value_type value_type;
- typedef typename implementation_defined::key_type key_type;
- typedef typename implementation_defined::value_traits value_traits;
- typedef typename implementation_defined::pointer pointer;
- typedef typename implementation_defined::const_pointer const_pointer;
- typedef typename implementation_defined::reference reference;
- typedef typename implementation_defined::const_reference const_reference;
- typedef typename implementation_defined::difference_type difference_type;
- typedef typename implementation_defined::size_type size_type;
- typedef typename implementation_defined::value_compare value_compare;
- typedef typename implementation_defined::key_compare key_compare;
- typedef typename implementation_defined::iterator iterator;
- typedef typename implementation_defined::const_iterator const_iterator;
- typedef typename implementation_defined::reverse_iterator reverse_iterator;
- typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
- typedef typename implementation_defined::insert_commit_data insert_commit_data;
- typedef typename implementation_defined::node_traits node_traits;
- typedef typename implementation_defined::node node;
- typedef typename implementation_defined::node_ptr node_ptr;
- typedef typename implementation_defined::const_node_ptr const_node_ptr;
- typedef typename implementation_defined::node_algorithms node_algorithms;
- static const bool constant_time_size = tree_type::constant_time_size;
- public:
- //! @copydoc ::boost::intrusive::bstree::bstree()
- bs_set_impl()
- : tree_type()
- {}
- //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
- explicit bs_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
- : tree_type(cmp, v_traits)
- {}
- //! @copydoc ::boost::intrusive::bstree::bstree(bool,Iterator,Iterator,const key_compare &,const value_traits &)
- template<class Iterator>
- bs_set_impl( Iterator b, Iterator e
- , const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
- : tree_type(true, b, e, cmp, v_traits)
- {}
- //! @copydoc ::boost::intrusive::bstree::bstree(bstree &&)
- bs_set_impl(BOOST_RV_REF(bs_set_impl) x)
- : tree_type(BOOST_MOVE_BASE(tree_type, x))
- {}
- //! @copydoc ::boost::intrusive::bstree::operator=(bstree &&)
- bs_set_impl& operator=(BOOST_RV_REF(bs_set_impl) x)
- { return static_cast<bs_set_impl&>(tree_type::operator=(BOOST_MOVE_BASE(tree_type, x))); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::~bstree()
- ~bs_set_impl();
- //! @copydoc ::boost::intrusive::bstree::begin()
- iterator begin() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::begin()const
- const_iterator begin() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::cbegin()const
- const_iterator cbegin() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::end()
- iterator end() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::end()const
- const_iterator end() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::cend()const
- const_iterator cend() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::rbegin()
- reverse_iterator rbegin() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::rbegin()const
- const_reverse_iterator rbegin() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::crbegin()const
- const_reverse_iterator crbegin() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::rend()
- reverse_iterator rend() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::rend()const
- const_reverse_iterator rend() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::crend()const
- const_reverse_iterator crend() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::root()
- iterator root() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::root()const
- const_iterator root() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::croot()const
- const_iterator croot() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator)
- static bs_set_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator)
- static const bs_set_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator)
- static bs_set_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator)
- static const bs_set_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::key_comp()const
- key_compare key_comp() const;
- //! @copydoc ::boost::intrusive::bstree::value_comp()const
- value_compare value_comp() const;
- //! @copydoc ::boost::intrusive::bstree::empty()const
- bool empty() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::size()const
- size_type size() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::swap
- void swap(bs_set_impl& other);
- //! @copydoc ::boost::intrusive::bstree::clone_from(const bstree&,Cloner,Disposer)
- template <class Cloner, class Disposer>
- void clone_from(const bs_set_impl &src, Cloner cloner, Disposer disposer);
- #else
- using tree_type::clone_from;
- #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::clone_from(bstree&&,Cloner,Disposer)
- template <class Cloner, class Disposer>
- void clone_from(BOOST_RV_REF(bs_set_impl) src, Cloner cloner, Disposer disposer)
- { tree_type::clone_from(BOOST_MOVE_BASE(tree_type, src), cloner, disposer); }
- //! @copydoc ::boost::intrusive::bstree::insert_unique(reference)
- std::pair<iterator, bool> insert(reference value)
- { return tree_type::insert_unique(value); }
- //! @copydoc ::boost::intrusive::bstree::insert_unique(const_iterator,reference)
- iterator insert(const_iterator hint, reference value)
- { return tree_type::insert_unique(hint, value); }
- //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&)
- std::pair<iterator, bool> insert_check
- (const key_type &key, insert_commit_data &commit_data)
- { return tree_type::insert_unique_check(key, commit_data); }
- //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&)
- std::pair<iterator, bool> insert_check
- (const_iterator hint, const key_type &key
- ,insert_commit_data &commit_data)
- { return tree_type::insert_unique_check(hint, key, commit_data); }
- //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<iterator, bool> insert_check
- (const KeyType &key, KeyTypeKeyCompare comp, insert_commit_data &commit_data)
- { return tree_type::insert_unique_check(key, comp, commit_data); }
- //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<iterator, bool> insert_check
- (const_iterator hint, const KeyType &key
- ,KeyTypeKeyCompare comp, insert_commit_data &commit_data)
- { return tree_type::insert_unique_check(hint, key, comp, commit_data); }
- //! @copydoc ::boost::intrusive::bstree::insert_unique(Iterator,Iterator)
- template<class Iterator>
- void insert(Iterator b, Iterator e)
- { tree_type::insert_unique(b, e); }
- //! @copydoc ::boost::intrusive::bstree::insert_unique_commit
- iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT
- { return tree_type::insert_unique_commit(value, commit_data); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::insert_before
- iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::push_back
- void push_back(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::push_front
- void push_front(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase(const_iterator)
- iterator erase(const_iterator i) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator)
- iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase(const key_type &)
- size_type erase(const key_type &key);
- //! @copydoc ::boost::intrusive::bstree::erase(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- size_type erase(const KeyType& key, KeyTypeKeyCompare comp);
- //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer)
- template<class Disposer>
- iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer)
- template<class Disposer>
- iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer)
- template<class Disposer>
- size_type erase_and_dispose(const key_type &key, Disposer disposer);
- //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const KeyType&,KeyTypeKeyCompare,Disposer)
- template<class KeyType, class KeyTypeKeyCompare, class Disposer>
- size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer);
- //! @copydoc ::boost::intrusive::bstree::clear
- void clear() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::clear_and_dispose
- template<class Disposer>
- void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT;
- #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::count(const key_type &)const
- size_type count(const key_type &key) const
- { return static_cast<size_type>(this->tree_type::find(key) != this->tree_type::cend()); }
- //! @copydoc ::boost::intrusive::bstree::count(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- size_type count(const KeyType& key, KeyTypeKeyCompare comp) const
- { return static_cast<size_type>(this->tree_type::find(key, comp) != this->tree_type::cend()); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::lower_bound(const key_type &)
- iterator lower_bound(const key_type &);
- //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- iterator lower_bound(const KeyType& key, KeyTypeKeyCompare comp);
- //! @copydoc ::boost::intrusive::bstree::lower_bound(const key_type &)const
- const_iterator lower_bound(const key_type &key) const;
- //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- const_iterator lower_bound(const KeyType& key, KeyTypeKeyCompare comp) const;
- //! @copydoc ::boost::intrusive::bstree::upper_bound(const key_type &)
- iterator upper_bound(const key_type &key);
- //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- iterator upper_bound(const KeyType& key, KeyTypeKeyCompare comp);
- //! @copydoc ::boost::intrusive::bstree::upper_bound(const key_type &)const
- const_iterator upper_bound(const key_type &key) const;
- //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- const_iterator upper_bound(const KeyType& key, KeyTypeKeyCompare comp) const;
- //! @copydoc ::boost::intrusive::bstree::find(const key_type &)
- iterator find(const key_type &key);
- //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- iterator find(const KeyType& key, KeyTypeKeyCompare comp);
- //! @copydoc ::boost::intrusive::bstree::find(const key_type &)const
- const_iterator find(const key_type &key) const;
- //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- const_iterator find(const KeyType& key, KeyTypeKeyCompare comp) const;
- #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::equal_range(const key_type &)
- std::pair<iterator,iterator> equal_range(const key_type &key)
- { return this->tree_type::lower_bound_range(key); }
- //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<iterator,iterator> equal_range(const KeyType& key, KeyTypeKeyCompare comp)
- { return this->tree_type::equal_range(key, comp); }
- //! @copydoc ::boost::intrusive::bstree::equal_range(const key_type &)const
- std::pair<const_iterator, const_iterator>
- equal_range(const key_type &key) const
- { return this->tree_type::lower_bound_range(key); }
- //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<const_iterator, const_iterator>
- equal_range(const KeyType& key, KeyTypeKeyCompare comp) const
- { return this->tree_type::equal_range(key, comp); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::bounded_range(const key_type&,const key_type&,bool,bool)
- std::pair<iterator,iterator> bounded_range
- (const key_type& lower_key, const key_type& upper_key, bool left_closed, bool right_closed);
- //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyTypeKeyCompare,bool,bool)
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<iterator,iterator> bounded_range
- (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed);
- //! @copydoc ::boost::intrusive::bstree::bounded_range(const key_type&,const key_type&,bool,bool)const
- std::pair<const_iterator, const_iterator>
- bounded_range(const key_type& lower_key, const key_type& upper_key, bool left_closed, bool right_closed) const;
- //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyTypeKeyCompare,bool,bool)const
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<const_iterator, const_iterator> bounded_range
- (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const;
- //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference)
- static iterator s_iterator_to(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference)
- static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::iterator_to(reference)
- iterator iterator_to(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const
- const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::init_node(reference)
- static void init_node(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance
- pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::replace_node
- void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::remove_node
- void remove_node(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::merge_unique
- template<class ...Options2>
- void merge(bs_set<T, Options2...> &source);
- //! @copydoc ::boost::intrusive::bstree::merge_unique
- template<class ...Options2>
- void merge(bs_multiset<T, Options2...> &source);
- #else
- template<class Compare2>
- void merge(bs_set_impl<ValueTraits, VoidOrKeyOfValue, Compare2, SizeType, ConstantTimeSize, HeaderHolder> &source)
- { return tree_type::merge_unique(source); }
- template<class Compare2>
- void merge(bs_multiset_impl<ValueTraits, VoidOrKeyOfValue, Compare2, SizeType, ConstantTimeSize, HeaderHolder> &source)
- { return tree_type::merge_unique(source); }
- #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- };
- #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
- template<class T, class ...Options>
- bool operator!= (const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
- template<class T, class ...Options>
- bool operator>(const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
- template<class T, class ...Options>
- bool operator<=(const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
- template<class T, class ...Options>
- bool operator>=(const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
- template<class T, class ...Options>
- void swap(bs_set_impl<T, Options...> &x, bs_set_impl<T, Options...> &y);
- #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
- //! Helper metafunction to define a \c bs_set that yields to the same type when the
- //! same options (either explicitly or implicitly) are used.
- #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- template<class T, class ...Options>
- #else
- template<class T, class O1 = void, class O2 = void
- , class O3 = void, class O4 = void
- , class O5 = void, class O6 = void>
- #endif
- struct make_bs_set
- {
- /// @cond
- typedef typename pack_options
- < bstree_defaults,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6
- #else
- Options...
- #endif
- >::type packed_options;
- typedef typename detail::get_value_traits
- <T, typename packed_options::proto_value_traits>::type value_traits;
- typedef bs_set_impl
- < value_traits
- , typename packed_options::key_of_value
- , typename packed_options::compare
- , typename packed_options::size_type
- , packed_options::constant_time_size
- , typename packed_options::header_holder_type
- > implementation_defined;
- /// @endcond
- typedef implementation_defined type;
- };
- #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- template<class T, class O1, class O2, class O3, class O4, class O5, class O6>
- #else
- template<class T, class ...Options>
- #endif
- class bs_set
- : public make_bs_set<T,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6
- #else
- Options...
- #endif
- >::type
- {
- typedef typename make_bs_set
- <T,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6
- #else
- Options...
- #endif
- >::type Base;
- BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_set)
- public:
- typedef typename Base::value_traits value_traits;
- typedef typename Base::key_compare key_compare;
- typedef typename Base::iterator iterator;
- typedef typename Base::const_iterator const_iterator;
- //Assert if passed value traits are compatible with the type
- BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
- inline bs_set()
- : Base()
- {}
- inline explicit bs_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
- : Base(cmp, v_traits)
- {}
- template<class Iterator>
- inline bs_set( Iterator b, Iterator e
- , const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
- : Base(b, e, cmp, v_traits)
- {}
- inline bs_set(BOOST_RV_REF(bs_set) x)
- : Base(BOOST_MOVE_BASE(Base, x))
- {}
- inline bs_set& operator=(BOOST_RV_REF(bs_set) x)
- { return static_cast<bs_set &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
- template <class Cloner, class Disposer>
- inline void clone_from(const bs_set &src, Cloner cloner, Disposer disposer)
- { Base::clone_from(src, cloner, disposer); }
- template <class Cloner, class Disposer>
- inline void clone_from(BOOST_RV_REF(bs_set) src, Cloner cloner, Disposer disposer)
- { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
- inline static bs_set &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT
- { return static_cast<bs_set &>(Base::container_from_end_iterator(end_iterator)); }
- inline static const bs_set &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT
- { return static_cast<const bs_set &>(Base::container_from_end_iterator(end_iterator)); }
- inline static bs_set &container_from_iterator(iterator it) BOOST_NOEXCEPT
- { return static_cast<bs_set &>(Base::container_from_iterator(it)); }
- inline static const bs_set &container_from_iterator(const_iterator it) BOOST_NOEXCEPT
- { return static_cast<const bs_set &>(Base::container_from_iterator(it)); }
- };
- #endif
- //! The class template bs_multiset is an intrusive container, that mimics most of
- //! the interface of std::multiset as described in the C++ standard.
- //!
- //! The template parameter \c T is the type to be managed by the container.
- //! The user can specify additional options and if no options are provided
- //! default options are used.
- //!
- //! The container supports the following options:
- //! \c base_hook<>/member_hook<>/value_traits<>,
- //! \c constant_time_size<>, \c size_type<> and
- //! \c compare<>.
- #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
- template<class T, class ...Options>
- #else
- template<class ValueTraits, class VoidOrKeyOfValue, class Compare, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
- #endif
- class bs_multiset_impl
- #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- : public bstree_impl<ValueTraits, VoidOrKeyOfValue, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>
- #endif
- {
- /// @cond
- typedef bstree_impl<ValueTraits, VoidOrKeyOfValue, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder> tree_type;
- BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_multiset_impl)
- typedef tree_type implementation_defined;
- /// @endcond
- public:
- typedef typename implementation_defined::value_type value_type;
- typedef typename implementation_defined::key_type key_type;
- typedef typename implementation_defined::value_traits value_traits;
- typedef typename implementation_defined::pointer pointer;
- typedef typename implementation_defined::const_pointer const_pointer;
- typedef typename implementation_defined::reference reference;
- typedef typename implementation_defined::const_reference const_reference;
- typedef typename implementation_defined::difference_type difference_type;
- typedef typename implementation_defined::size_type size_type;
- typedef typename implementation_defined::value_compare value_compare;
- typedef typename implementation_defined::key_compare key_compare;
- typedef typename implementation_defined::iterator iterator;
- typedef typename implementation_defined::const_iterator const_iterator;
- typedef typename implementation_defined::reverse_iterator reverse_iterator;
- typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
- typedef typename implementation_defined::insert_commit_data insert_commit_data;
- typedef typename implementation_defined::node_traits node_traits;
- typedef typename implementation_defined::node node;
- typedef typename implementation_defined::node_ptr node_ptr;
- typedef typename implementation_defined::const_node_ptr const_node_ptr;
- typedef typename implementation_defined::node_algorithms node_algorithms;
- static const bool constant_time_size = tree_type::constant_time_size;
- public:
- //! @copydoc ::boost::intrusive::bstree::bstree()
- bs_multiset_impl()
- : tree_type()
- {}
- //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
- explicit bs_multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
- : tree_type(cmp, v_traits)
- {}
- //! @copydoc ::boost::intrusive::bstree::bstree(bool,Iterator,Iterator,const key_compare &,const value_traits &)
- template<class Iterator>
- bs_multiset_impl( Iterator b, Iterator e
- , const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
- : tree_type(false, b, e, cmp, v_traits)
- {}
- //! @copydoc ::boost::intrusive::bstree::bstree(bstree &&)
- bs_multiset_impl(BOOST_RV_REF(bs_multiset_impl) x)
- : tree_type(BOOST_MOVE_BASE(tree_type, x))
- {}
- //! @copydoc ::boost::intrusive::bstree::operator=(bstree &&)
- bs_multiset_impl& operator=(BOOST_RV_REF(bs_multiset_impl) x)
- { return static_cast<bs_multiset_impl&>(tree_type::operator=(BOOST_MOVE_BASE(tree_type, x))); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::~bstree()
- ~bs_multiset_impl();
- //! @copydoc ::boost::intrusive::bstree::begin()
- iterator begin() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::begin()const
- const_iterator begin() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::cbegin()const
- const_iterator cbegin() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::end()
- iterator end() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::end()const
- const_iterator end() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::cend()const
- const_iterator cend() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::rbegin()
- reverse_iterator rbegin() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::rbegin()const
- const_reverse_iterator rbegin() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::crbegin()const
- const_reverse_iterator crbegin() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::rend()
- reverse_iterator rend() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::rend()const
- const_reverse_iterator rend() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::crend()const
- const_reverse_iterator crend() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::root()
- iterator root() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::root()const
- const_iterator root() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::croot()const
- const_iterator croot() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator)
- static bs_multiset_impl &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator)
- static const bs_multiset_impl &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator)
- static bs_multiset_impl &container_from_iterator(iterator it) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator)
- static const bs_multiset_impl &container_from_iterator(const_iterator it) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::key_comp()const
- key_compare key_comp() const;
- //! @copydoc ::boost::intrusive::bstree::value_comp()const
- value_compare value_comp() const;
- //! @copydoc ::boost::intrusive::bstree::empty()const
- bool empty() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::size()const
- size_type size() const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::swap
- void swap(bs_multiset_impl& other);
- //! @copydoc ::boost::intrusive::bstree::clone_from(const bstree&,Cloner,Disposer)
- template <class Cloner, class Disposer>
- void clone_from(const bs_multiset_impl &src, Cloner cloner, Disposer disposer);
- #else
- using tree_type::clone_from;
- #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::clone_from(bstree&&,Cloner,Disposer)
- template <class Cloner, class Disposer>
- void clone_from(BOOST_RV_REF(bs_multiset_impl) src, Cloner cloner, Disposer disposer)
- { tree_type::clone_from(BOOST_MOVE_BASE(tree_type, src), cloner, disposer); }
- //! @copydoc ::boost::intrusive::bstree::insert_equal(reference)
- iterator insert(reference value)
- { return tree_type::insert_equal(value); }
- //! @copydoc ::boost::intrusive::bstree::insert_equal(const_iterator,reference)
- iterator insert(const_iterator hint, reference value)
- { return tree_type::insert_equal(hint, value); }
- //! @copydoc ::boost::intrusive::bstree::insert_equal(Iterator,Iterator)
- template<class Iterator>
- void insert(Iterator b, Iterator e)
- { tree_type::insert_equal(b, e); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::bstree::insert_before
- iterator insert_before(const_iterator pos, reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::push_back
- void push_back(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::push_front
- void push_front(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase(const_iterator)
- iterator erase(const_iterator i) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator)
- iterator erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase(const key_type &)
- size_type erase(const key_type &key);
- //! @copydoc ::boost::intrusive::bstree::erase(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- size_type erase(const KeyType& key, KeyTypeKeyCompare comp);
- //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer)
- template<class Disposer>
- iterator erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer)
- template<class Disposer>
- iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const key_type &, Disposer)
- template<class Disposer>
- size_type erase_and_dispose(const key_type &key, Disposer disposer);
- //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const KeyType&,KeyTypeKeyCompare,Disposer)
- template<class KeyType, class KeyTypeKeyCompare, class Disposer>
- size_type erase_and_dispose(const KeyType& key, KeyTypeKeyCompare comp, Disposer disposer);
- //! @copydoc ::boost::intrusive::bstree::clear
- void clear() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::clear_and_dispose
- template<class Disposer>
- void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::count(const key_type &)const
- size_type count(const key_type &key) const;
- //! @copydoc ::boost::intrusive::bstree::count(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- size_type count(const KeyType& key, KeyTypeKeyCompare comp) const;
- //! @copydoc ::boost::intrusive::bstree::lower_bound(const key_type &)
- iterator lower_bound(const key_type &key);
- //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- iterator lower_bound(const KeyType& key, KeyTypeKeyCompare comp);
- //! @copydoc ::boost::intrusive::bstree::lower_bound(const key_type &)const
- const_iterator lower_bound(const key_type &key) const;
- //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- const_iterator lower_bound(const KeyType& key, KeyTypeKeyCompare comp) const;
- //! @copydoc ::boost::intrusive::bstree::upper_bound(const key_type &)
- iterator upper_bound(const key_type &key);
- //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- iterator upper_bound(const KeyType& key, KeyTypeKeyCompare comp);
- //! @copydoc ::boost::intrusive::bstree::upper_bound(const key_type &)const
- const_iterator upper_bound(const key_type &key) const;
- //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- const_iterator upper_bound(const KeyType& key, KeyTypeKeyCompare comp) const;
- //! @copydoc ::boost::intrusive::bstree::find(const key_type &)
- iterator find(const key_type &key);
- //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- iterator find(const KeyType& key, KeyTypeKeyCompare comp);
- //! @copydoc ::boost::intrusive::bstree::find(const key_type &)const
- const_iterator find(const key_type &key) const;
- //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- const_iterator find(const KeyType& key, KeyTypeKeyCompare comp) const;
- //! @copydoc ::boost::intrusive::bstree::equal_range(const key_type &)
- std::pair<iterator,iterator> equal_range(const key_type &key);
- //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyTypeKeyCompare)
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<iterator,iterator> equal_range(const KeyType& key, KeyTypeKeyCompare comp);
- //! @copydoc ::boost::intrusive::bstree::equal_range(const key_type &)const
- std::pair<const_iterator, const_iterator>
- equal_range(const key_type &key) const;
- //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyTypeKeyCompare)const
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<const_iterator, const_iterator>
- equal_range(const KeyType& key, KeyTypeKeyCompare comp) const;
- //! @copydoc ::boost::intrusive::bstree::bounded_range(const key_type &,const key_type &,bool,bool)
- std::pair<iterator,iterator> bounded_range
- (const key_type & lower_key, const key_type & upper_key, bool left_closed, bool right_closed);
- //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyTypeKeyCompare,bool,bool)
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<iterator,iterator> bounded_range
- (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed);
- //! @copydoc ::boost::intrusive::bstree::bounded_range(const key_type &,const key_type &,bool,bool)const
- std::pair<const_iterator, const_iterator>
- bounded_range(const key_type & lower_key, const key_type & upper_key, bool left_closed, bool right_closed) const;
- //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyTypeKeyCompare,bool,bool)const
- template<class KeyType, class KeyTypeKeyCompare>
- std::pair<const_iterator, const_iterator> bounded_range
- (const KeyType& lower_key, const KeyType& upper_key, KeyTypeKeyCompare comp, bool left_closed, bool right_closed) const;
- //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference)
- static iterator s_iterator_to(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference)
- static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::iterator_to(reference)
- iterator iterator_to(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const
- const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::init_node(reference)
- static void init_node(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance
- pointer unlink_leftmost_without_rebalance() BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::replace_node
- void replace_node(iterator replace_this, reference with_this) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::remove_node
- void remove_node(reference value) BOOST_NOEXCEPT;
- //! @copydoc ::boost::intrusive::bstree::merge_equal
- template<class ...Options2>
- void merge(bs_multiset<T, Options2...> &source);
- //! @copydoc ::boost::intrusive::bstree::merge_equal
- template<class ...Options2>
- void merge(bs_set<T, Options2...> &source);
- #else
- template<class Compare2>
- void merge(bs_multiset_impl<ValueTraits, VoidOrKeyOfValue, Compare2, SizeType, ConstantTimeSize, HeaderHolder> &source)
- { return tree_type::merge_equal(source); }
- template<class Compare2>
- void merge(bs_set_impl<ValueTraits, VoidOrKeyOfValue, Compare2, SizeType, ConstantTimeSize, HeaderHolder> &source)
- { return tree_type::merge_equal(source); }
- #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- };
- #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
- template<class T, class ...Options>
- bool operator!= (const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
- template<class T, class ...Options>
- bool operator>(const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
- template<class T, class ...Options>
- bool operator<=(const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
- template<class T, class ...Options>
- bool operator>=(const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
- template<class T, class ...Options>
- void swap(bs_multiset_impl<T, Options...> &x, bs_multiset_impl<T, Options...> &y);
- #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
- //! Helper metafunction to define a \c bs_multiset that yields to the same type when the
- //! same options (either explicitly or implicitly) are used.
- #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- template<class T, class ...Options>
- #else
- template<class T, class O1 = void, class O2 = void
- , class O3 = void, class O4 = void
- , class O5 = void, class O6 = void>
- #endif
- struct make_bs_multiset
- {
- /// @cond
- typedef typename pack_options
- < bstree_defaults,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6
- #else
- Options...
- #endif
- >::type packed_options;
- typedef typename detail::get_value_traits
- <T, typename packed_options::proto_value_traits>::type value_traits;
- typedef bs_multiset_impl
- < value_traits
- , typename packed_options::key_of_value
- , typename packed_options::compare
- , typename packed_options::size_type
- , packed_options::constant_time_size
- , typename packed_options::header_holder_type
- > implementation_defined;
- /// @endcond
- typedef implementation_defined type;
- };
- #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- template<class T, class O1, class O2, class O3, class O4, class O5, class O6>
- #else
- template<class T, class ...Options>
- #endif
- class bs_multiset
- : public make_bs_multiset<T,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6
- #else
- Options...
- #endif
- >::type
- {
- typedef typename make_bs_multiset<T,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6
- #else
- Options...
- #endif
- >::type Base;
- BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_multiset)
- public:
- typedef typename Base::key_compare key_compare;
- typedef typename Base::value_traits value_traits;
- typedef typename Base::iterator iterator;
- typedef typename Base::const_iterator const_iterator;
- //Assert if passed value traits are compatible with the type
- BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
- inline bs_multiset()
- : Base()
- {}
- inline explicit bs_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
- : Base(cmp, v_traits)
- {}
- template<class Iterator>
- inline bs_multiset( Iterator b, Iterator e
- , const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
- : Base(b, e, cmp, v_traits)
- {}
- inline bs_multiset(BOOST_RV_REF(bs_multiset) x)
- : Base(BOOST_MOVE_BASE(Base, x))
- {}
- inline bs_multiset& operator=(BOOST_RV_REF(bs_multiset) x)
- { return static_cast<bs_multiset &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
- template <class Cloner, class Disposer>
- inline void clone_from(const bs_multiset &src, Cloner cloner, Disposer disposer)
- { Base::clone_from(src, cloner, disposer); }
- template <class Cloner, class Disposer>
- inline void clone_from(BOOST_RV_REF(bs_multiset) src, Cloner cloner, Disposer disposer)
- { Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
- inline static bs_multiset &container_from_end_iterator(iterator end_iterator) BOOST_NOEXCEPT
- { return static_cast<bs_multiset &>(Base::container_from_end_iterator(end_iterator)); }
- inline static const bs_multiset &container_from_end_iterator(const_iterator end_iterator) BOOST_NOEXCEPT
- { return static_cast<const bs_multiset &>(Base::container_from_end_iterator(end_iterator)); }
- inline static bs_multiset &container_from_iterator(iterator it) BOOST_NOEXCEPT
- { return static_cast<bs_multiset &>(Base::container_from_iterator(it)); }
- inline static const bs_multiset &container_from_iterator(const_iterator it) BOOST_NOEXCEPT
- { return static_cast<const bs_multiset &>(Base::container_from_iterator(it)); }
- };
- #endif
- } //namespace intrusive
- } //namespace boost
- #include <boost/intrusive/detail/config_end.hpp>
- #endif //BOOST_INTRUSIVE_BS_SET_HPP
|