12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004 |
- #ifndef BOOST_INTRUSIVE_UNORDERED_SET_HPP
- #define BOOST_INTRUSIVE_UNORDERED_SET_HPP
- #include <boost/intrusive/detail/config_begin.hpp>
- #include <boost/intrusive/intrusive_fwd.hpp>
- #include <boost/intrusive/hashtable.hpp>
- #include <boost/move/utility_core.hpp>
- #if defined(BOOST_HAS_PRAGMA_ONCE)
- # pragma once
- #endif
- namespace boost {
- namespace intrusive {
- #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
- template<class T, class ...Options>
- #else
- template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyHash, class VoidOrKeyEqual, class SizeType, class BucketTraits, std::size_t BoolFlags>
- #endif
- class unordered_set_impl
- #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- : public hashtable_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags|hash_bool_flags::unique_keys_pos>
- #endif
- {
-
- private:
- typedef hashtable_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags|hash_bool_flags::unique_keys_pos> table_type;
- template<class Iterator, class MaybeConstThis, class KeyType, class KeyHasher, class KeyEqual>
- static std::pair<Iterator,Iterator> priv_equal_range(MaybeConstThis &c, const KeyType& key, KeyHasher hash_func, KeyEqual equal_func)
- {
- Iterator const it = c.find(key, hash_func, equal_func);
- std::pair<Iterator,Iterator> ret(it, it);
- if(it != c.end())
- ++ret.second;
- return ret;
- }
-
-
- BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_set_impl)
- typedef table_type implementation_defined;
-
- public:
- typedef typename implementation_defined::value_type value_type;
- typedef typename implementation_defined::key_type key_type;
- typedef typename implementation_defined::key_of_value key_of_value;
- typedef typename implementation_defined::value_traits value_traits;
- typedef typename implementation_defined::bucket_traits bucket_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::key_equal key_equal;
- typedef typename implementation_defined::hasher hasher;
- typedef typename implementation_defined::bucket_type bucket_type;
- typedef typename implementation_defined::bucket_ptr bucket_ptr;
- typedef typename implementation_defined::iterator iterator;
- typedef typename implementation_defined::const_iterator const_iterator;
- typedef typename implementation_defined::insert_commit_data insert_commit_data;
- typedef typename implementation_defined::local_iterator local_iterator;
- typedef typename implementation_defined::const_local_iterator const_local_iterator;
- 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;
- public:
-
- inline explicit unordered_set_impl( const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
- : table_type(b_traits, hash_func, equal_func, v_traits)
- {}
-
- template<class Iterator>
- inline unordered_set_impl( Iterator b
- , Iterator e
- , const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
- : table_type(true, b, e, b_traits, hash_func, equal_func, v_traits)
- {}
-
- inline unordered_set_impl(BOOST_RV_REF(unordered_set_impl) x)
- : table_type(BOOST_MOVE_BASE(table_type, x))
- {}
-
- inline unordered_set_impl& operator=(BOOST_RV_REF(unordered_set_impl) x)
- { return static_cast<unordered_set_impl&>(table_type::operator=(BOOST_MOVE_BASE(table_type, x))); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
-
- ~unordered_set_impl();
-
- iterator begin() BOOST_NOEXCEPT;
-
- const_iterator begin() const BOOST_NOEXCEPT;
-
- const_iterator cbegin() const BOOST_NOEXCEPT;
-
- iterator end() BOOST_NOEXCEPT;
-
- const_iterator end() const BOOST_NOEXCEPT;
-
- const_iterator cend() const BOOST_NOEXCEPT;
-
- hasher hash_function() const;
-
- key_equal key_eq() const;
-
- bool empty() const BOOST_NOEXCEPT;
-
- size_type size() const BOOST_NOEXCEPT;
-
- void swap(unordered_set_impl& other);
-
- template <class Cloner, class Disposer>
- void clone_from(const unordered_set_impl &src, Cloner cloner, Disposer disposer);
- #else
- using table_type::clone_from;
- #endif
-
- template <class Cloner, class Disposer>
- inline void clone_from(BOOST_RV_REF(unordered_set_impl) src, Cloner cloner, Disposer disposer)
- { table_type::clone_from(BOOST_MOVE_BASE(table_type, src), cloner, disposer); }
-
- inline std::pair<iterator, bool> insert(reference value)
- { return table_type::insert_unique(value); }
-
- template<class Iterator>
- inline void insert(Iterator b, Iterator e)
- { table_type::insert_unique(b, e); }
-
- inline std::pair<iterator, bool> insert_check(const key_type &key, insert_commit_data &commit_data)
- { return table_type::insert_unique_check(key, commit_data); }
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- inline std::pair<iterator, bool> insert_check
- (const KeyType &key, KeyHasher hash_func, KeyEqual key_value_equal, insert_commit_data &commit_data)
- { return table_type::insert_unique_check(key, hash_func, key_value_equal, commit_data); }
-
- inline iterator insert_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT
- { return table_type::insert_unique_commit(value, commit_data); }
-
- inline iterator insert_fast_commit(reference value, const insert_commit_data &commit_data) BOOST_NOEXCEPT
- { return table_type::insert_unique_fast_commit(value, commit_data); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
-
- void erase(const_iterator i);
-
- void erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT;
-
- size_type erase(const key_type &key);
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- size_type erase(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func);
-
- template<class Disposer>
- BOOST_INTRUSIVE_DOC1ST(void
- , typename detail::disable_if_convertible<Disposer BOOST_INTRUSIVE_I const_iterator>::type)
- erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT;
-
- template<class Disposer>
- void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT;
-
- template<class Disposer>
- size_type erase_and_dispose(const key_type &key, Disposer disposer);
-
- template<class KeyType, class KeyHasher, class KeyEqual, class Disposer>
- size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func, Disposer disposer);
-
- void clear() BOOST_NOEXCEPT;
-
- template<class Disposer>
- void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT;
-
- size_type count(const key_type &key) const;
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- size_type count(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func) const;
-
- iterator find(const key_type &key);
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- iterator find(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func);
-
- const_iterator find(const key_type &key) const;
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- const_iterator find(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func) const;
- #endif
-
- std::pair<iterator,iterator> equal_range(const key_type &key)
- { return this->equal_range(key, this->hash_function(), this->key_eq()); }
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- std::pair<iterator,iterator> equal_range(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func)
- { return this->priv_equal_range<iterator>(*this, key, hash_func, equal_func); }
-
- std::pair<const_iterator, const_iterator>
- equal_range(const key_type &key) const
- { return this->equal_range(key, this->hash_function(), this->key_eq()); }
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- std::pair<const_iterator, const_iterator>
- equal_range(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func) const
- { return this->priv_equal_range<const_iterator>(*this, key, hash_func, equal_func); }
- #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
-
- iterator iterator_to(reference value) BOOST_NOEXCEPT;
-
- const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT;
-
- static local_iterator s_local_iterator_to(reference value) BOOST_NOEXCEPT;
-
- static const_local_iterator s_local_iterator_to(const_reference value) BOOST_NOEXCEPT;
-
- local_iterator local_iterator_to(reference value) BOOST_NOEXCEPT;
-
- const_local_iterator local_iterator_to(const_reference value) const BOOST_NOEXCEPT;
-
- size_type bucket_count() const BOOST_NOEXCEPT;
-
- size_type bucket_size(size_type n) const BOOST_NOEXCEPT;
-
- size_type bucket(const key_type& k) const;
-
- template<class KeyType, class KeyHasher>
- size_type bucket(const KeyType& k, KeyHasher hash_func) const;
-
- bucket_ptr bucket_pointer() const BOOST_NOEXCEPT;
-
- local_iterator begin(size_type n) BOOST_NOEXCEPT;
-
- const_local_iterator begin(size_type n) const BOOST_NOEXCEPT;
-
- const_local_iterator cbegin(size_type n) const BOOST_NOEXCEPT;
-
- local_iterator end(size_type n) BOOST_NOEXCEPT;
-
- const_local_iterator end(size_type n) const BOOST_NOEXCEPT;
-
- const_local_iterator cend(size_type n) const BOOST_NOEXCEPT;
-
- void rehash(const bucket_traits &new_bucket_traits);
-
- void full_rehash();
-
- bool incremental_rehash(bool grow = true);
-
- bool incremental_rehash(const bucket_traits &new_bucket_traits);
-
- size_type split_count() const BOOST_NOEXCEPT;
-
- static size_type suggested_upper_bucket_count(size_type n) BOOST_NOEXCEPT;
-
- static size_type suggested_lower_bucket_count(size_type n) BOOST_NOEXCEPT;
- #endif
- friend bool operator==(const unordered_set_impl &x, const unordered_set_impl &y)
- {
- if(table_type::constant_time_size && x.size() != y.size()){
- return false;
- }
-
- for (const_iterator ix = x.cbegin(), ex = x.cend(), ey = y.cend(); ix != ex; ++ix){
- const_iterator iy = y.find(key_of_value()(*ix));
- if (iy == ey || !(*ix == *iy))
- return false;
- }
- return true;
- }
- friend bool operator!=(const unordered_set_impl &x, const unordered_set_impl &y)
- { return !(x == y); }
- friend bool operator<(const unordered_set_impl &x, const unordered_set_impl &y)
- { return ::boost::intrusive::algo_lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
- friend bool operator>(const unordered_set_impl &x, const unordered_set_impl &y)
- { return y < x; }
- friend bool operator<=(const unordered_set_impl &x, const unordered_set_impl &y)
- { return !(y < x); }
- friend bool operator>=(const unordered_set_impl &x, const unordered_set_impl &y)
- { return !(x < y); }
- };
- #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
- , class O7 = void, class O8 = void
- , class O9 = void, class O10= void
- , class O11 = void
- >
- #endif
- struct make_unordered_set
- {
-
- typedef typename pack_options
- < hashtable_defaults,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11
- #else
- Options...
- #endif
- >::type packed_options;
- typedef typename detail::get_value_traits
- <T, typename packed_options::proto_value_traits>::type value_traits;
- typedef typename make_bucket_traits
- <T, packed_options>::type bucket_traits;
- typedef unordered_set_impl
- < value_traits
- , typename packed_options::key_of_value
- , typename packed_options::hash
- , typename packed_options::equal
- , typename packed_options::size_type
- , bucket_traits
- , (std::size_t(true)*hash_bool_flags::unique_keys_pos)
- | (std::size_t(packed_options::constant_time_size)*hash_bool_flags::constant_time_size_pos)
- | (std::size_t(packed_options::power_2_buckets)*hash_bool_flags::power_2_buckets_pos)
- | (std::size_t(packed_options::cache_begin)*hash_bool_flags::cache_begin_pos)
- | (std::size_t(packed_options::compare_hash)*hash_bool_flags::compare_hash_pos)
- | (std::size_t(packed_options::incremental)*hash_bool_flags::incremental_pos)
- | (std::size_t(packed_options::linear_buckets)*hash_bool_flags::linear_buckets_pos)
- | (std::size_t(packed_options::fastmod_buckets)*hash_bool_flags::fastmod_buckets_pos)
- > implementation_defined;
-
- 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, class O7, class O8, class O9, class O10, class O11>
- #else
- template<class T, class ...Options>
- #endif
- class unordered_set
- : public make_unordered_set<T,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11
- #else
- Options...
- #endif
- >::type
- {
- typedef typename make_unordered_set<T,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11
- #else
- Options...
- #endif
- >::type Base;
-
- BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
- BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_set)
- public:
- typedef typename Base::value_traits value_traits;
- typedef typename Base::bucket_traits bucket_traits;
- typedef typename Base::iterator iterator;
- typedef typename Base::const_iterator const_iterator;
- typedef typename Base::bucket_ptr bucket_ptr;
- typedef typename Base::size_type size_type;
- typedef typename Base::hasher hasher;
- typedef typename Base::key_equal key_equal;
- inline
- explicit unordered_set ( const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
- : Base(b_traits, hash_func, equal_func, v_traits)
- {}
- template<class Iterator>
- inline
- unordered_set
- ( Iterator b, Iterator e
- , const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
- : Base(b, e, b_traits, hash_func, equal_func, v_traits)
- {}
- inline unordered_set(BOOST_RV_REF(unordered_set) x)
- : Base(BOOST_MOVE_BASE(Base, x))
- {}
- inline unordered_set& operator=(BOOST_RV_REF(unordered_set) x)
- { return static_cast<unordered_set&>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
- template <class Cloner, class Disposer>
- inline void clone_from(const unordered_set &src, Cloner cloner, Disposer disposer)
- { this->Base::clone_from(src, cloner, disposer); }
- template <class Cloner, class Disposer>
- inline void clone_from(BOOST_RV_REF(unordered_set) src, Cloner cloner, Disposer disposer)
- { this->Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
- };
- #endif
- #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
- template<class T, class ...Options>
- #else
- template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyHash, class VoidOrKeyEqual, class SizeType, class BucketTraits, std::size_t BoolFlags>
- #endif
- class unordered_multiset_impl
- #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- : public hashtable_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags>
- #endif
- {
-
- private:
- typedef hashtable_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags> table_type;
-
-
- BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_multiset_impl)
- typedef table_type implementation_defined;
- 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::bucket_traits bucket_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::key_equal key_equal;
- typedef typename implementation_defined::hasher hasher;
- typedef typename implementation_defined::bucket_type bucket_type;
- typedef typename implementation_defined::bucket_ptr bucket_ptr;
- typedef typename implementation_defined::iterator iterator;
- typedef typename implementation_defined::const_iterator const_iterator;
- typedef typename implementation_defined::insert_commit_data insert_commit_data;
- typedef typename implementation_defined::local_iterator local_iterator;
- typedef typename implementation_defined::const_local_iterator const_local_iterator;
- 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;
- public:
-
- inline explicit unordered_multiset_impl ( const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
- : table_type(b_traits, hash_func, equal_func, v_traits)
- {}
-
- template<class Iterator>
- inline unordered_multiset_impl ( Iterator b
- , Iterator e
- , const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
- : table_type(false, b, e, b_traits, hash_func, equal_func, v_traits)
- {}
-
-
- inline unordered_multiset_impl(BOOST_RV_REF(unordered_multiset_impl) x)
- : table_type(BOOST_MOVE_BASE(table_type, x))
- {}
-
-
- inline unordered_multiset_impl& operator=(BOOST_RV_REF(unordered_multiset_impl) x)
- { return static_cast<unordered_multiset_impl&>(table_type::operator=(BOOST_MOVE_BASE(table_type, x))); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
-
- ~unordered_multiset_impl();
-
- iterator begin() BOOST_NOEXCEPT;
-
- const_iterator begin() const BOOST_NOEXCEPT;
-
- const_iterator cbegin() const BOOST_NOEXCEPT;
-
- iterator end() BOOST_NOEXCEPT;
-
- const_iterator end() const BOOST_NOEXCEPT;
-
- const_iterator cend() const BOOST_NOEXCEPT;
-
- hasher hash_function() const;
-
- key_equal key_eq() const;
-
- bool empty() const BOOST_NOEXCEPT;
-
- size_type size() const BOOST_NOEXCEPT;
-
- void swap(unordered_multiset_impl& other);
-
- template <class Cloner, class Disposer>
- void clone_from(const unordered_multiset_impl &src, Cloner cloner, Disposer disposer);
- #else
- using table_type::clone_from;
- #endif
-
- template <class Cloner, class Disposer>
- inline void clone_from(BOOST_RV_REF(unordered_multiset_impl) src, Cloner cloner, Disposer disposer)
- { table_type::clone_from(BOOST_MOVE_BASE(table_type, src), cloner, disposer); }
-
- inline iterator insert(reference value)
- { return table_type::insert_equal(value); }
-
- template<class Iterator>
- inline void insert(Iterator b, Iterator e)
- { table_type::insert_equal(b, e); }
- #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
-
- void erase(const_iterator i);
-
- void erase(const_iterator b, const_iterator e) BOOST_NOEXCEPT;
-
- size_type erase(const key_type &key);
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- size_type erase(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func);
-
- template<class Disposer>
- BOOST_INTRUSIVE_DOC1ST(void
- , typename detail::disable_if_convertible<Disposer BOOST_INTRUSIVE_I const_iterator>::type)
- erase_and_dispose(const_iterator i, Disposer disposer) BOOST_NOEXCEPT;
-
- template<class Disposer>
- void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer) BOOST_NOEXCEPT;
-
- template<class Disposer>
- size_type erase_and_dispose(const key_type &key, Disposer disposer);
-
- template<class KeyType, class KeyHasher, class KeyEqual, class Disposer>
- size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func, Disposer disposer);
-
- void clear() BOOST_NOEXCEPT;
-
- template<class Disposer>
- void clear_and_dispose(Disposer disposer) BOOST_NOEXCEPT;
-
- size_type count(const key_type &key) const;
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- size_type count(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func) const;
-
- iterator find(const key_type &key);
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- iterator find(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func);
-
- const_iterator find(const key_type &key) const;
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- const_iterator find(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func) const;
-
- std::pair<iterator,iterator> equal_range(const key_type &key);
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- std::pair<iterator,iterator> equal_range(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func);
-
- std::pair<const_iterator, const_iterator>
- equal_range(const key_type &key) const;
-
- template<class KeyType, class KeyHasher, class KeyEqual>
- std::pair<const_iterator, const_iterator>
- equal_range(const KeyType& key, KeyHasher hash_func, KeyEqual equal_func) const;
-
- iterator iterator_to(reference value) BOOST_NOEXCEPT;
-
- const_iterator iterator_to(const_reference value) const BOOST_NOEXCEPT;
-
- static local_iterator s_local_iterator_to(reference value) BOOST_NOEXCEPT;
-
- static const_local_iterator s_local_iterator_to(const_reference value) BOOST_NOEXCEPT;
-
- local_iterator local_iterator_to(reference value) BOOST_NOEXCEPT;
-
- const_local_iterator local_iterator_to(const_reference value) const BOOST_NOEXCEPT;
-
- size_type bucket_count() const BOOST_NOEXCEPT;
-
- size_type bucket_size(size_type n) const BOOST_NOEXCEPT;
-
- size_type bucket(const key_type& k) const;
-
- template<class KeyType, class KeyHasher>
- size_type bucket(const KeyType& k, KeyHasher hash_func) const;
-
- bucket_ptr bucket_pointer() const BOOST_NOEXCEPT;
-
- local_iterator begin(size_type n) BOOST_NOEXCEPT;
-
- const_local_iterator begin(size_type n) const BOOST_NOEXCEPT;
-
- const_local_iterator cbegin(size_type n) const BOOST_NOEXCEPT;
-
- local_iterator end(size_type n) BOOST_NOEXCEPT;
-
- const_local_iterator end(size_type n) const BOOST_NOEXCEPT;
-
- const_local_iterator cend(size_type n) const BOOST_NOEXCEPT;
-
- void rehash(const bucket_traits &new_bucket_traits);
-
- void full_rehash();
-
- bool incremental_rehash(bool grow = true);
-
- bool incremental_rehash(const bucket_traits &new_bucket_traits);
-
- size_type split_count() const BOOST_NOEXCEPT;
-
- static size_type suggested_upper_bucket_count(size_type n) BOOST_NOEXCEPT;
-
- static size_type suggested_lower_bucket_count(size_type n) BOOST_NOEXCEPT;
- #endif
- };
- #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
- , class O7 = void, class O8 = void
- , class O9 = void, class O10= void
- , class O11 = void
- >
- #endif
- struct make_unordered_multiset
- {
-
- typedef typename pack_options
- < hashtable_defaults,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11
- #else
- Options...
- #endif
- >::type packed_options;
- typedef typename detail::get_value_traits
- <T, typename packed_options::proto_value_traits>::type value_traits;
- typedef typename make_bucket_traits
- <T, packed_options>::type bucket_traits;
- typedef unordered_multiset_impl
- < value_traits
- , typename packed_options::key_of_value
- , typename packed_options::hash
- , typename packed_options::equal
- , typename packed_options::size_type
- , bucket_traits
- , (std::size_t(false)*hash_bool_flags::unique_keys_pos)
- | (std::size_t(packed_options::constant_time_size)*hash_bool_flags::constant_time_size_pos)
- | (std::size_t(packed_options::power_2_buckets)*hash_bool_flags::power_2_buckets_pos)
- | (std::size_t(packed_options::cache_begin)*hash_bool_flags::cache_begin_pos)
- | (std::size_t(packed_options::compare_hash)*hash_bool_flags::compare_hash_pos)
- | (std::size_t(packed_options::incremental)*hash_bool_flags::incremental_pos)
- | (std::size_t(packed_options::linear_buckets)*hash_bool_flags::linear_buckets_pos)
- | (std::size_t(packed_options::fastmod_buckets)*hash_bool_flags::fastmod_buckets_pos)
- > implementation_defined;
-
- 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, class O7, class O8, class O9, class O10, class O11>
- #else
- template<class T, class ...Options>
- #endif
- class unordered_multiset
- : public make_unordered_multiset<T,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11
- #else
- Options...
- #endif
- >::type
- {
- typedef typename make_unordered_multiset
- <T,
- #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
- O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
- #else
- Options...
- #endif
- >::type Base;
-
- BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
- BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_multiset)
- public:
- typedef typename Base::value_traits value_traits;
- typedef typename Base::bucket_traits bucket_traits;
- typedef typename Base::iterator iterator;
- typedef typename Base::const_iterator const_iterator;
- typedef typename Base::bucket_ptr bucket_ptr;
- typedef typename Base::size_type size_type;
- typedef typename Base::hasher hasher;
- typedef typename Base::key_equal key_equal;
- inline
- explicit unordered_multiset( const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
- : Base(b_traits, hash_func, equal_func, v_traits)
- {}
- template<class Iterator>
- inline
- unordered_multiset( Iterator b
- , Iterator e
- , const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
- : Base(b, e, b_traits, hash_func, equal_func, v_traits)
- {}
- inline unordered_multiset(BOOST_RV_REF(unordered_multiset) x)
- : Base(BOOST_MOVE_BASE(Base, x))
- {}
- inline unordered_multiset& operator=(BOOST_RV_REF(unordered_multiset) x)
- { return static_cast<unordered_multiset&>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
- template <class Cloner, class Disposer>
- inline void clone_from(const unordered_multiset &src, Cloner cloner, Disposer disposer)
- { this->Base::clone_from(src, cloner, disposer); }
- template <class Cloner, class Disposer>
- inline void clone_from(BOOST_RV_REF(unordered_multiset) src, Cloner cloner, Disposer disposer)
- { this->Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
- };
- #endif
- }
- }
- #include <boost/intrusive/detail/config_end.hpp>
- #endif
|