Chris@16
|
1 /////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 //
|
Chris@16
|
3 // (C) Copyright Olaf Krzikalla 2004-2006.
|
Chris@101
|
4 // (C) Copyright Ion Gaztanaga 2006-2014
|
Chris@16
|
5 //
|
Chris@16
|
6 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
7 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
8 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
9 //
|
Chris@16
|
10 // See http://www.boost.org/libs/intrusive for documentation.
|
Chris@16
|
11 //
|
Chris@16
|
12 /////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
13 #ifndef BOOST_INTRUSIVE_UNORDERED_SET_HPP
|
Chris@16
|
14 #define BOOST_INTRUSIVE_UNORDERED_SET_HPP
|
Chris@16
|
15
|
Chris@16
|
16 #include <boost/intrusive/detail/config_begin.hpp>
|
Chris@16
|
17 #include <boost/intrusive/intrusive_fwd.hpp>
|
Chris@16
|
18 #include <boost/intrusive/hashtable.hpp>
|
Chris@101
|
19 #include <boost/move/utility_core.hpp>
|
Chris@101
|
20 #include <boost/static_assert.hpp>
|
Chris@16
|
21
|
Chris@101
|
22 #if defined(BOOST_HAS_PRAGMA_ONCE)
|
Chris@101
|
23 # pragma once
|
Chris@101
|
24 #endif
|
Chris@16
|
25
|
Chris@16
|
26 namespace boost {
|
Chris@16
|
27 namespace intrusive {
|
Chris@16
|
28
|
Chris@16
|
29 //! The class template unordered_set is an intrusive container, that mimics most of
|
Chris@16
|
30 //! the interface of std::tr1::unordered_set as described in the C++ TR1.
|
Chris@16
|
31 //!
|
Chris@16
|
32 //! unordered_set is a semi-intrusive container: each object to be stored in the
|
Chris@16
|
33 //! container must contain a proper hook, but the container also needs
|
Chris@16
|
34 //! additional auxiliary memory to work: unordered_set needs a pointer to an array
|
Chris@16
|
35 //! of type `bucket_type` to be passed in the constructor. This bucket array must
|
Chris@16
|
36 //! have at least the same lifetime as the container. This makes the use of
|
Chris@16
|
37 //! unordered_set more complicated than purely intrusive containers.
|
Chris@16
|
38 //! `bucket_type` is default-constructible, copyable and assignable
|
Chris@16
|
39 //!
|
Chris@16
|
40 //! The template parameter \c T is the type to be managed by the container.
|
Chris@16
|
41 //! The user can specify additional options and if no options are provided
|
Chris@16
|
42 //! default options are used.
|
Chris@16
|
43 //!
|
Chris@16
|
44 //! The container supports the following options:
|
Chris@16
|
45 //! \c base_hook<>/member_hook<>/value_traits<>,
|
Chris@16
|
46 //! \c constant_time_size<>, \c size_type<>, \c hash<> and \c equal<>
|
Chris@16
|
47 //! \c bucket_traits<>, \c power_2_buckets<> and \c cache_begin<>.
|
Chris@16
|
48 //!
|
Chris@16
|
49 //! unordered_set only provides forward iterators but it provides 4 iterator types:
|
Chris@16
|
50 //! iterator and const_iterator to navigate through the whole container and
|
Chris@16
|
51 //! local_iterator and const_local_iterator to navigate through the values
|
Chris@16
|
52 //! stored in a single bucket. Local iterators are faster and smaller.
|
Chris@16
|
53 //!
|
Chris@16
|
54 //! It's not recommended to use non constant-time size unordered_sets because several
|
Chris@16
|
55 //! key functions, like "empty()", become non-constant time functions. Non
|
Chris@16
|
56 //! constant-time size unordered_sets are mainly provided to support auto-unlink hooks.
|
Chris@16
|
57 //!
|
Chris@16
|
58 //! unordered_set, unlike std::unordered_set, does not make automatic rehashings nor
|
Chris@16
|
59 //! offers functions related to a load factor. Rehashing can be explicitly requested
|
Chris@16
|
60 //! and the user must provide a new bucket array that will be used from that moment.
|
Chris@16
|
61 //!
|
Chris@16
|
62 //! Since no automatic rehashing is done, iterators are never invalidated when
|
Chris@16
|
63 //! inserting or erasing elements. Iterators are only invalidated when rehasing.
|
Chris@16
|
64 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
65 template<class T, class ...Options>
|
Chris@16
|
66 #else
|
Chris@16
|
67 template<class ValueTraits, class Hash, class Equal, class SizeType, class BucketTraits, std::size_t BoolFlags>
|
Chris@16
|
68 #endif
|
Chris@16
|
69 class unordered_set_impl
|
Chris@16
|
70 : public hashtable_impl<ValueTraits, Hash, Equal, SizeType, BucketTraits, BoolFlags>
|
Chris@16
|
71 {
|
Chris@16
|
72 /// @cond
|
Chris@16
|
73 private:
|
Chris@16
|
74 typedef hashtable_impl<ValueTraits, Hash, Equal, SizeType, BucketTraits, BoolFlags> table_type;
|
Chris@16
|
75
|
Chris@16
|
76 //! This class is
|
Chris@16
|
77 //! movable
|
Chris@16
|
78 BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_set_impl)
|
Chris@16
|
79
|
Chris@16
|
80 typedef table_type implementation_defined;
|
Chris@16
|
81 /// @endcond
|
Chris@16
|
82
|
Chris@16
|
83 public:
|
Chris@16
|
84 typedef typename implementation_defined::value_type value_type;
|
Chris@16
|
85 typedef typename implementation_defined::value_traits value_traits;
|
Chris@16
|
86 typedef typename implementation_defined::bucket_traits bucket_traits;
|
Chris@16
|
87 typedef typename implementation_defined::pointer pointer;
|
Chris@16
|
88 typedef typename implementation_defined::const_pointer const_pointer;
|
Chris@16
|
89 typedef typename implementation_defined::reference reference;
|
Chris@16
|
90 typedef typename implementation_defined::const_reference const_reference;
|
Chris@16
|
91 typedef typename implementation_defined::difference_type difference_type;
|
Chris@16
|
92 typedef typename implementation_defined::size_type size_type;
|
Chris@16
|
93 typedef typename implementation_defined::key_type key_type;
|
Chris@16
|
94 typedef typename implementation_defined::key_equal key_equal;
|
Chris@16
|
95 typedef typename implementation_defined::hasher hasher;
|
Chris@16
|
96 typedef typename implementation_defined::bucket_type bucket_type;
|
Chris@16
|
97 typedef typename implementation_defined::bucket_ptr bucket_ptr;
|
Chris@16
|
98 typedef typename implementation_defined::iterator iterator;
|
Chris@16
|
99 typedef typename implementation_defined::const_iterator const_iterator;
|
Chris@16
|
100 typedef typename implementation_defined::insert_commit_data insert_commit_data;
|
Chris@16
|
101 typedef typename implementation_defined::local_iterator local_iterator;
|
Chris@16
|
102 typedef typename implementation_defined::const_local_iterator const_local_iterator;
|
Chris@16
|
103 typedef typename implementation_defined::node_traits node_traits;
|
Chris@16
|
104 typedef typename implementation_defined::node node;
|
Chris@16
|
105 typedef typename implementation_defined::node_ptr node_ptr;
|
Chris@16
|
106 typedef typename implementation_defined::const_node_ptr const_node_ptr;
|
Chris@16
|
107 typedef typename implementation_defined::node_algorithms node_algorithms;
|
Chris@16
|
108
|
Chris@16
|
109 public:
|
Chris@16
|
110
|
Chris@16
|
111 //! <b>Requires</b>: buckets must not be being used by any other resource.
|
Chris@16
|
112 //!
|
Chris@16
|
113 //! <b>Effects</b>: Constructs an empty unordered_set_impl, storing a reference
|
Chris@16
|
114 //! to the bucket array and copies of the hasher and equal functors.
|
Chris@16
|
115 //!
|
Chris@16
|
116 //! <b>Complexity</b>: Constant.
|
Chris@16
|
117 //!
|
Chris@16
|
118 //! <b>Throws</b>: If value_traits::node_traits::node
|
Chris@16
|
119 //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
Chris@16
|
120 //! or the copy constructor or invocation of Hash or Equal throws.
|
Chris@16
|
121 //!
|
Chris@16
|
122 //! <b>Notes</b>: buckets array must be disposed only after
|
Chris@16
|
123 //! *this is disposed.
|
Chris@16
|
124 explicit unordered_set_impl( const bucket_traits &b_traits
|
Chris@16
|
125 , const hasher & hash_func = hasher()
|
Chris@16
|
126 , const key_equal &equal_func = key_equal()
|
Chris@16
|
127 , const value_traits &v_traits = value_traits())
|
Chris@16
|
128 : table_type(b_traits, hash_func, equal_func, v_traits)
|
Chris@16
|
129 {}
|
Chris@16
|
130
|
Chris@16
|
131 //! <b>Requires</b>: buckets must not be being used by any other resource
|
Chris@16
|
132 //! and Dereferencing iterator must yield an lvalue of type value_type.
|
Chris@16
|
133 //!
|
Chris@16
|
134 //! <b>Effects</b>: Constructs an empty unordered_set and inserts elements from
|
Chris@16
|
135 //! [b, e).
|
Chris@16
|
136 //!
|
Chris@101
|
137 //! <b>Complexity</b>: If N is distance(b, e): Average case is O(N)
|
Chris@16
|
138 //! (with a good hash function and with buckets_len >= N),worst case O(N2).
|
Chris@16
|
139 //!
|
Chris@16
|
140 //! <b>Throws</b>: If value_traits::node_traits::node
|
Chris@16
|
141 //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
Chris@16
|
142 //! or the copy constructor or invocation of hasher or key_equal throws.
|
Chris@16
|
143 //!
|
Chris@16
|
144 //! <b>Notes</b>: buckets array must be disposed only after
|
Chris@16
|
145 //! *this is disposed.
|
Chris@16
|
146 template<class Iterator>
|
Chris@16
|
147 unordered_set_impl( Iterator b
|
Chris@16
|
148 , Iterator e
|
Chris@16
|
149 , const bucket_traits &b_traits
|
Chris@16
|
150 , const hasher & hash_func = hasher()
|
Chris@16
|
151 , const key_equal &equal_func = key_equal()
|
Chris@16
|
152 , const value_traits &v_traits = value_traits())
|
Chris@16
|
153 : table_type(b_traits, hash_func, equal_func, v_traits)
|
Chris@16
|
154 { table_type::insert_unique(b, e); }
|
Chris@16
|
155
|
Chris@16
|
156 //! <b>Effects</b>: to-do
|
Chris@16
|
157 //!
|
Chris@16
|
158 unordered_set_impl(BOOST_RV_REF(unordered_set_impl) x)
|
Chris@101
|
159 : table_type(BOOST_MOVE_BASE(table_type, x))
|
Chris@16
|
160 {}
|
Chris@16
|
161
|
Chris@16
|
162 //! <b>Effects</b>: to-do
|
Chris@16
|
163 //!
|
Chris@16
|
164 unordered_set_impl& operator=(BOOST_RV_REF(unordered_set_impl) x)
|
Chris@101
|
165 { return static_cast<unordered_set_impl&>(table_type::operator=(BOOST_MOVE_BASE(table_type, x))); }
|
Chris@16
|
166
|
Chris@16
|
167 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
168 //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_set
|
Chris@16
|
169 //! are not deleted (i.e. no destructors are called).
|
Chris@16
|
170 //!
|
Chris@16
|
171 //! <b>Complexity</b>: Linear to the number of elements in the unordered_set, if
|
Chris@16
|
172 //! it's a safe-mode or auto-unlink value. Otherwise constant.
|
Chris@16
|
173 //!
|
Chris@16
|
174 //! <b>Throws</b>: Nothing.
|
Chris@16
|
175 ~unordered_set_impl()
|
Chris@16
|
176 {}
|
Chris@16
|
177
|
Chris@16
|
178 //! <b>Effects</b>: Returns an iterator pointing to the beginning of the unordered_set.
|
Chris@16
|
179 //!
|
Chris@16
|
180 //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
|
Chris@16
|
181 //! constant time with worst case (empty unordered_set) O(this->bucket_count())
|
Chris@16
|
182 //!
|
Chris@16
|
183 //! <b>Throws</b>: Nothing.
|
Chris@16
|
184 iterator begin()
|
Chris@16
|
185 { return table_type::begin(); }
|
Chris@16
|
186
|
Chris@16
|
187 //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
|
Chris@16
|
188 //! of the unordered_set.
|
Chris@16
|
189 //!
|
Chris@16
|
190 //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
|
Chris@16
|
191 //! constant time with worst case (empty unordered_set) O(this->bucket_count())
|
Chris@16
|
192 //!
|
Chris@16
|
193 //! <b>Throws</b>: Nothing.
|
Chris@16
|
194 const_iterator begin() const
|
Chris@16
|
195 { return table_type::begin(); }
|
Chris@16
|
196
|
Chris@16
|
197 //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
|
Chris@16
|
198 //! of the unordered_set.
|
Chris@16
|
199 //!
|
Chris@16
|
200 //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
|
Chris@16
|
201 //! constant time with worst case (empty unordered_set) O(this->bucket_count())
|
Chris@16
|
202 //!
|
Chris@16
|
203 //! <b>Throws</b>: Nothing.
|
Chris@16
|
204 const_iterator cbegin() const
|
Chris@16
|
205 { return table_type::cbegin(); }
|
Chris@16
|
206
|
Chris@16
|
207 //! <b>Effects</b>: Returns an iterator pointing to the end of the unordered_set.
|
Chris@16
|
208 //!
|
Chris@16
|
209 //! <b>Complexity</b>: Constant.
|
Chris@16
|
210 //!
|
Chris@16
|
211 //! <b>Throws</b>: Nothing.
|
Chris@16
|
212 iterator end()
|
Chris@16
|
213 { return table_type::end(); }
|
Chris@16
|
214
|
Chris@16
|
215 //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
|
Chris@16
|
216 //!
|
Chris@16
|
217 //! <b>Complexity</b>: Constant.
|
Chris@16
|
218 //!
|
Chris@16
|
219 //! <b>Throws</b>: Nothing.
|
Chris@16
|
220 const_iterator end() const
|
Chris@16
|
221 { return table_type::end(); }
|
Chris@16
|
222
|
Chris@16
|
223 //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
|
Chris@16
|
224 //!
|
Chris@16
|
225 //! <b>Complexity</b>: Constant.
|
Chris@16
|
226 //!
|
Chris@16
|
227 //! <b>Throws</b>: Nothing.
|
Chris@16
|
228 const_iterator cend() const
|
Chris@16
|
229 { return table_type::cend(); }
|
Chris@16
|
230
|
Chris@16
|
231 //! <b>Effects</b>: Returns the hasher object used by the unordered_set.
|
Chris@16
|
232 //!
|
Chris@16
|
233 //! <b>Complexity</b>: Constant.
|
Chris@16
|
234 //!
|
Chris@16
|
235 //! <b>Throws</b>: If hasher copy-constructor throws.
|
Chris@16
|
236 hasher hash_function() const
|
Chris@16
|
237 { return table_type::hash_function(); }
|
Chris@16
|
238
|
Chris@16
|
239 //! <b>Effects</b>: Returns the key_equal object used by the unordered_set.
|
Chris@16
|
240 //!
|
Chris@16
|
241 //! <b>Complexity</b>: Constant.
|
Chris@16
|
242 //!
|
Chris@16
|
243 //! <b>Throws</b>: If key_equal copy-constructor throws.
|
Chris@16
|
244 key_equal key_eq() const
|
Chris@16
|
245 { return table_type::key_eq(); }
|
Chris@16
|
246
|
Chris@16
|
247 //! <b>Effects</b>: Returns true if the container is empty.
|
Chris@16
|
248 //!
|
Chris@16
|
249 //! <b>Complexity</b>: if constant-time size and cache_last options are disabled,
|
Chris@16
|
250 //! average constant time (worst case, with empty() == true: O(this->bucket_count()).
|
Chris@16
|
251 //! Otherwise constant.
|
Chris@16
|
252 //!
|
Chris@16
|
253 //! <b>Throws</b>: Nothing.
|
Chris@16
|
254 bool empty() const
|
Chris@16
|
255 { return table_type::empty(); }
|
Chris@16
|
256
|
Chris@16
|
257 //! <b>Effects</b>: Returns the number of elements stored in the unordered_set.
|
Chris@16
|
258 //!
|
Chris@16
|
259 //! <b>Complexity</b>: Linear to elements contained in *this if
|
Chris@16
|
260 //! constant-time size option is disabled. Constant-time otherwise.
|
Chris@16
|
261 //!
|
Chris@16
|
262 //! <b>Throws</b>: Nothing.
|
Chris@16
|
263 size_type size() const
|
Chris@16
|
264 { return table_type::size(); }
|
Chris@16
|
265
|
Chris@16
|
266 //! <b>Requires</b>: the hasher and the equality function unqualified swap
|
Chris@16
|
267 //! call should not throw.
|
Chris@16
|
268 //!
|
Chris@16
|
269 //! <b>Effects</b>: Swaps the contents of two unordered_sets.
|
Chris@16
|
270 //! Swaps also the contained bucket array and equality and hasher functors.
|
Chris@16
|
271 //!
|
Chris@16
|
272 //! <b>Complexity</b>: Constant.
|
Chris@16
|
273 //!
|
Chris@16
|
274 //! <b>Throws</b>: If the swap() call for the comparison or hash functors
|
Chris@16
|
275 //! found using ADL throw. Basic guarantee.
|
Chris@16
|
276 void swap(unordered_set_impl& other)
|
Chris@16
|
277 { table_type::swap(other.table_); }
|
Chris@16
|
278
|
Chris@16
|
279 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
280 //! Cloner should yield to nodes that compare equal and produce the same
|
Chris@16
|
281 //! hash than the original node.
|
Chris@16
|
282 //!
|
Chris@16
|
283 //! <b>Effects</b>: Erases all the elements from *this
|
Chris@16
|
284 //! calling Disposer::operator()(pointer), clones all the
|
Chris@16
|
285 //! elements from src calling Cloner::operator()(const_reference )
|
Chris@16
|
286 //! and inserts them on *this. The hash function and the equality
|
Chris@16
|
287 //! predicate are copied from the source.
|
Chris@16
|
288 //!
|
Chris@16
|
289 //! If store_hash option is true, this method does not use the hash function.
|
Chris@16
|
290 //!
|
Chris@16
|
291 //! If any operation throws, all cloned elements are unlinked and disposed
|
Chris@16
|
292 //! calling Disposer::operator()(pointer).
|
Chris@16
|
293 //!
|
Chris@16
|
294 //! <b>Complexity</b>: Linear to erased plus inserted elements.
|
Chris@16
|
295 //!
|
Chris@16
|
296 //! <b>Throws</b>: If cloner or hasher throw or hash or equality predicate copying
|
Chris@16
|
297 //! throws. Basic guarantee.
|
Chris@16
|
298 template <class Cloner, class Disposer>
|
Chris@16
|
299 void clone_from(const unordered_set_impl &src, Cloner cloner, Disposer disposer)
|
Chris@16
|
300 { table_type::clone_from(src.table_, cloner, disposer); }
|
Chris@16
|
301
|
Chris@16
|
302 #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
303
|
Chris@16
|
304 //! <b>Requires</b>: value must be an lvalue
|
Chris@16
|
305 //!
|
Chris@16
|
306 //! <b>Effects</b>: Tries to inserts value into the unordered_set.
|
Chris@16
|
307 //!
|
Chris@16
|
308 //! <b>Returns</b>: If the value
|
Chris@16
|
309 //! is not already present inserts it and returns a pair containing the
|
Chris@16
|
310 //! iterator to the new value and true. If there is an equivalent value
|
Chris@16
|
311 //! returns a pair containing an iterator to the already present value
|
Chris@16
|
312 //! and false.
|
Chris@16
|
313 //!
|
Chris@16
|
314 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
315 //!
|
Chris@16
|
316 //! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
|
Chris@16
|
317 //!
|
Chris@16
|
318 //! <b>Note</b>: Does not affect the validity of iterators and references.
|
Chris@16
|
319 //! No copy-constructors are called.
|
Chris@16
|
320 std::pair<iterator, bool> insert(reference value)
|
Chris@16
|
321 { return table_type::insert_unique(value); }
|
Chris@16
|
322
|
Chris@16
|
323 //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
|
Chris@16
|
324 //! of type value_type.
|
Chris@16
|
325 //!
|
Chris@16
|
326 //! <b>Effects</b>: Equivalent to this->insert(t) for each element in [b, e).
|
Chris@16
|
327 //!
|
Chris@101
|
328 //! <b>Complexity</b>: Average case O(N), where N is distance(b, e).
|
Chris@16
|
329 //! Worst case O(N*this->size()).
|
Chris@16
|
330 //!
|
Chris@16
|
331 //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
|
Chris@16
|
332 //!
|
Chris@16
|
333 //! <b>Note</b>: Does not affect the validity of iterators and references.
|
Chris@16
|
334 //! No copy-constructors are called.
|
Chris@16
|
335 template<class Iterator>
|
Chris@16
|
336 void insert(Iterator b, Iterator e)
|
Chris@16
|
337 { table_type::insert_unique(b, e); }
|
Chris@16
|
338
|
Chris@16
|
339 //! <b>Requires</b>: "hasher" must be a hash function that induces
|
Chris@16
|
340 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
341 //! "hasher" hashes the given key instead of the value_type.
|
Chris@16
|
342 //!
|
Chris@16
|
343 //! "key_value_equal" must be a equality function that induces
|
Chris@16
|
344 //! the same equality as key_equal. The difference is that
|
Chris@16
|
345 //! "key_value_equal" compares an arbitrary key with the contained values.
|
Chris@16
|
346 //!
|
Chris@16
|
347 //! <b>Effects</b>: Checks if a value can be inserted in the unordered_set, using
|
Chris@16
|
348 //! a user provided key instead of the value itself.
|
Chris@16
|
349 //!
|
Chris@16
|
350 //! <b>Returns</b>: If there is an equivalent value
|
Chris@16
|
351 //! returns a pair containing an iterator to the already present value
|
Chris@16
|
352 //! and false. If the value can be inserted returns true in the returned
|
Chris@16
|
353 //! pair boolean and fills "commit_data" that is meant to be used with
|
Chris@16
|
354 //! the "insert_commit" function.
|
Chris@16
|
355 //!
|
Chris@16
|
356 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
357 //!
|
Chris@16
|
358 //! <b>Throws</b>: If hasher or key_value_equal throw. Strong guarantee.
|
Chris@16
|
359 //!
|
Chris@16
|
360 //! <b>Notes</b>: This function is used to improve performance when constructing
|
Chris@16
|
361 //! a value_type is expensive: if there is an equivalent value
|
Chris@16
|
362 //! the constructed object must be discarded. Many times, the part of the
|
Chris@16
|
363 //! node that is used to impose the hash or the equality is much cheaper to
|
Chris@16
|
364 //! construct than the value_type and this function offers the possibility to
|
Chris@16
|
365 //! use that the part to check if the insertion will be successful.
|
Chris@16
|
366 //!
|
Chris@16
|
367 //! If the check is successful, the user can construct the value_type and use
|
Chris@16
|
368 //! "insert_commit" to insert the object in constant-time.
|
Chris@16
|
369 //!
|
Chris@16
|
370 //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
|
Chris@16
|
371 //! objects are inserted or erased from the unordered_set.
|
Chris@16
|
372 //!
|
Chris@16
|
373 //! After a successful rehashing insert_commit_data remains valid.
|
Chris@16
|
374 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
375 std::pair<iterator, bool> insert_check
|
Chris@16
|
376 (const KeyType &key, KeyHasher hasher, KeyValueEqual key_value_equal, insert_commit_data &commit_data)
|
Chris@16
|
377 { return table_type::insert_unique_check(key, hasher, key_value_equal, commit_data); }
|
Chris@16
|
378
|
Chris@16
|
379 //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
|
Chris@16
|
380 //! must have been obtained from a previous call to "insert_check".
|
Chris@16
|
381 //! No objects should have been inserted or erased from the unordered_set between
|
Chris@16
|
382 //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
|
Chris@16
|
383 //!
|
Chris@16
|
384 //! <b>Effects</b>: Inserts the value in the unordered_set using the information obtained
|
Chris@16
|
385 //! from the "commit_data" that a previous "insert_check" filled.
|
Chris@16
|
386 //!
|
Chris@16
|
387 //! <b>Returns</b>: An iterator to the newly inserted object.
|
Chris@16
|
388 //!
|
Chris@16
|
389 //! <b>Complexity</b>: Constant time.
|
Chris@16
|
390 //!
|
Chris@16
|
391 //! <b>Throws</b>: Nothing.
|
Chris@16
|
392 //!
|
Chris@16
|
393 //! <b>Notes</b>: This function has only sense if a "insert_check" has been
|
Chris@16
|
394 //! previously executed to fill "commit_data". No value should be inserted or
|
Chris@16
|
395 //! erased between the "insert_check" and "insert_commit" calls.
|
Chris@16
|
396 //!
|
Chris@16
|
397 //! After a successful rehashing insert_commit_data remains valid.
|
Chris@16
|
398 iterator insert_commit(reference value, const insert_commit_data &commit_data)
|
Chris@16
|
399 { return table_type::insert_unique_commit(value, commit_data); }
|
Chris@16
|
400
|
Chris@16
|
401 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
402
|
Chris@16
|
403 //! <b>Effects</b>: Erases the element pointed to by i.
|
Chris@16
|
404 //!
|
Chris@16
|
405 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
406 //!
|
Chris@16
|
407 //! <b>Throws</b>: Nothing.
|
Chris@16
|
408 //!
|
Chris@16
|
409 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
410 //! to the erased element. No destructors are called.
|
Chris@16
|
411 void erase(const_iterator i)
|
Chris@16
|
412 { table_type::erase(i); }
|
Chris@16
|
413
|
Chris@16
|
414 //! <b>Effects</b>: Erases the range pointed to by b end e.
|
Chris@16
|
415 //!
|
Chris@101
|
416 //! <b>Complexity</b>: Average case O(distance(b, e)),
|
Chris@16
|
417 //! worst case O(this->size()).
|
Chris@16
|
418 //!
|
Chris@16
|
419 //! <b>Throws</b>: Nothing.
|
Chris@16
|
420 //!
|
Chris@16
|
421 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
422 //! to the erased elements. No destructors are called.
|
Chris@16
|
423 void erase(const_iterator b, const_iterator e)
|
Chris@16
|
424 { table_type::erase(b, e); }
|
Chris@16
|
425
|
Chris@16
|
426 //! <b>Effects</b>: Erases all the elements with the given value.
|
Chris@16
|
427 //!
|
Chris@16
|
428 //! <b>Returns</b>: The number of erased elements.
|
Chris@16
|
429 //!
|
Chris@16
|
430 //! <b>Complexity</b>: Average case O(this->count(value)).
|
Chris@16
|
431 //! Worst case O(this->size()).
|
Chris@16
|
432 //!
|
Chris@16
|
433 //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
|
Chris@16
|
434 //!
|
Chris@16
|
435 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
436 //! to the erased elements. No destructors are called.
|
Chris@16
|
437 size_type erase(const_reference value)
|
Chris@16
|
438 { return table_type::erase(value); }
|
Chris@16
|
439
|
Chris@16
|
440 //! <b>Requires</b>: "hasher" must be a hash function that induces
|
Chris@16
|
441 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
442 //! "hasher" hashes the given key instead of the value_type.
|
Chris@16
|
443 //!
|
Chris@16
|
444 //! "key_value_equal" must be a equality function that induces
|
Chris@16
|
445 //! the same equality as key_equal. The difference is that
|
Chris@16
|
446 //! "key_value_equal" compares an arbitrary key with the contained values.
|
Chris@16
|
447 //!
|
Chris@16
|
448 //! <b>Effects</b>: Erases all the elements that have the same hash and
|
Chris@16
|
449 //! compare equal with the given key.
|
Chris@16
|
450 //!
|
Chris@16
|
451 //! <b>Returns</b>: The number of erased elements.
|
Chris@16
|
452 //!
|
Chris@16
|
453 //! <b>Complexity</b>: Average case O(this->count(value)).
|
Chris@16
|
454 //! Worst case O(this->size()).
|
Chris@16
|
455 //!
|
Chris@16
|
456 //! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
|
Chris@16
|
457 //!
|
Chris@16
|
458 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
459 //! to the erased elements. No destructors are called.
|
Chris@16
|
460 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
461 size_type erase(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
|
Chris@16
|
462 { return table_type::erase(key, hash_func, equal_func); }
|
Chris@16
|
463
|
Chris@16
|
464 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
465 //!
|
Chris@16
|
466 //! <b>Effects</b>: Erases the element pointed to by i.
|
Chris@16
|
467 //! Disposer::operator()(pointer) is called for the removed element.
|
Chris@16
|
468 //!
|
Chris@16
|
469 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
470 //!
|
Chris@16
|
471 //! <b>Throws</b>: Nothing.
|
Chris@16
|
472 //!
|
Chris@16
|
473 //! <b>Note</b>: Invalidates the iterators
|
Chris@16
|
474 //! to the erased elements.
|
Chris@16
|
475 template<class Disposer>
|
Chris@16
|
476 void erase_and_dispose(const_iterator i, Disposer disposer
|
Chris@16
|
477 /// @cond
|
Chris@16
|
478 , typename detail::enable_if_c<!detail::is_convertible<Disposer, const_iterator>::value >::type * = 0
|
Chris@16
|
479 /// @endcond
|
Chris@16
|
480 )
|
Chris@16
|
481 { table_type::erase_and_dispose(i, disposer); }
|
Chris@16
|
482
|
Chris@16
|
483 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
484 //!
|
Chris@16
|
485 //! <b>Effects</b>: Erases the range pointed to by b end e.
|
Chris@16
|
486 //! Disposer::operator()(pointer) is called for the removed elements.
|
Chris@16
|
487 //!
|
Chris@101
|
488 //! <b>Complexity</b>: Average case O(distance(b, e)),
|
Chris@16
|
489 //! worst case O(this->size()).
|
Chris@16
|
490 //!
|
Chris@16
|
491 //! <b>Throws</b>: Nothing.
|
Chris@16
|
492 //!
|
Chris@16
|
493 //! <b>Note</b>: Invalidates the iterators
|
Chris@16
|
494 //! to the erased elements.
|
Chris@16
|
495 template<class Disposer>
|
Chris@16
|
496 void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
|
Chris@16
|
497 { table_type::erase_and_dispose(b, e, disposer); }
|
Chris@16
|
498
|
Chris@16
|
499 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
500 //!
|
Chris@16
|
501 //! <b>Effects</b>: Erases all the elements with the given value.
|
Chris@16
|
502 //! Disposer::operator()(pointer) is called for the removed elements.
|
Chris@16
|
503 //!
|
Chris@16
|
504 //! <b>Returns</b>: The number of erased elements.
|
Chris@16
|
505 //!
|
Chris@16
|
506 //! <b>Complexity</b>: Average case O(this->count(value)).
|
Chris@16
|
507 //! Worst case O(this->size()).
|
Chris@16
|
508 //!
|
Chris@16
|
509 //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
|
Chris@16
|
510 //!
|
Chris@16
|
511 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
512 //! to the erased elements. No destructors are called.
|
Chris@16
|
513 template<class Disposer>
|
Chris@16
|
514 size_type erase_and_dispose(const_reference value, Disposer disposer)
|
Chris@16
|
515 { return table_type::erase_and_dispose(value, disposer); }
|
Chris@16
|
516
|
Chris@16
|
517 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
518 //!
|
Chris@16
|
519 //! <b>Effects</b>: Erases all the elements with the given key.
|
Chris@16
|
520 //! according to the comparison functor "equal_func".
|
Chris@16
|
521 //! Disposer::operator()(pointer) is called for the removed elements.
|
Chris@16
|
522 //!
|
Chris@16
|
523 //! <b>Returns</b>: The number of erased elements.
|
Chris@16
|
524 //!
|
Chris@16
|
525 //! <b>Complexity</b>: Average case O(this->count(value)).
|
Chris@16
|
526 //! Worst case O(this->size()).
|
Chris@16
|
527 //!
|
Chris@16
|
528 //! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
|
Chris@16
|
529 //!
|
Chris@16
|
530 //! <b>Note</b>: Invalidates the iterators
|
Chris@16
|
531 //! to the erased elements.
|
Chris@16
|
532 template<class KeyType, class KeyHasher, class KeyValueEqual, class Disposer>
|
Chris@16
|
533 size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func, Disposer disposer)
|
Chris@16
|
534 { return table_type::erase_and_dispose(key, hash_func, equal_func, disposer); }
|
Chris@16
|
535
|
Chris@16
|
536 //! <b>Effects</b>: Erases all of the elements.
|
Chris@16
|
537 //!
|
Chris@16
|
538 //! <b>Complexity</b>: Linear to the number of elements on the container.
|
Chris@16
|
539 //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
|
Chris@16
|
540 //!
|
Chris@16
|
541 //! <b>Throws</b>: Nothing.
|
Chris@16
|
542 //!
|
Chris@16
|
543 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
544 //! to the erased elements. No destructors are called.
|
Chris@16
|
545 void clear()
|
Chris@16
|
546 { return table_type::clear(); }
|
Chris@16
|
547
|
Chris@16
|
548 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
549 //!
|
Chris@16
|
550 //! <b>Effects</b>: Erases all of the elements.
|
Chris@16
|
551 //!
|
Chris@16
|
552 //! <b>Complexity</b>: Linear to the number of elements on the container.
|
Chris@16
|
553 //! Disposer::operator()(pointer) is called for the removed elements.
|
Chris@16
|
554 //!
|
Chris@16
|
555 //! <b>Throws</b>: Nothing.
|
Chris@16
|
556 //!
|
Chris@16
|
557 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
558 //! to the erased elements. No destructors are called.
|
Chris@16
|
559 template<class Disposer>
|
Chris@16
|
560 void clear_and_dispose(Disposer disposer)
|
Chris@16
|
561 { return table_type::clear_and_dispose(disposer); }
|
Chris@16
|
562
|
Chris@16
|
563 //! <b>Effects</b>: Returns the number of contained elements with the given value
|
Chris@16
|
564 //!
|
Chris@16
|
565 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
566 //!
|
Chris@16
|
567 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
568 size_type count(const_reference value) const
|
Chris@16
|
569 { return table_type::find(value) != end(); }
|
Chris@16
|
570
|
Chris@16
|
571 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
572 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
573 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
574 //!
|
Chris@16
|
575 //! "equal_func" must be a equality function that induces
|
Chris@16
|
576 //! the same equality as key_equal. The difference is that
|
Chris@16
|
577 //! "equal_func" compares an arbitrary key with the contained values.
|
Chris@16
|
578 //!
|
Chris@16
|
579 //! <b>Effects</b>: Returns the number of contained elements with the given key
|
Chris@16
|
580 //!
|
Chris@16
|
581 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
582 //!
|
Chris@16
|
583 //! <b>Throws</b>: If hash_func or equal_func throw.
|
Chris@16
|
584 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
585 size_type count(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
|
Chris@16
|
586 { return table_type::find(key, hash_func, equal_func) != end(); }
|
Chris@16
|
587
|
Chris@16
|
588 //! <b>Effects</b>: Finds an iterator to the first element is equal to
|
Chris@16
|
589 //! "value" or end() if that element does not exist.
|
Chris@16
|
590 //!
|
Chris@16
|
591 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
592 //!
|
Chris@16
|
593 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
594 iterator find(const_reference value)
|
Chris@16
|
595 { return table_type::find(value); }
|
Chris@16
|
596
|
Chris@16
|
597 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
598 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
599 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
600 //!
|
Chris@16
|
601 //! "equal_func" must be a equality function that induces
|
Chris@16
|
602 //! the same equality as key_equal. The difference is that
|
Chris@16
|
603 //! "equal_func" compares an arbitrary key with the contained values.
|
Chris@16
|
604 //!
|
Chris@16
|
605 //! <b>Effects</b>: Finds an iterator to the first element whose key is
|
Chris@16
|
606 //! "key" according to the given hasher and equality functor or end() if
|
Chris@16
|
607 //! that element does not exist.
|
Chris@16
|
608 //!
|
Chris@16
|
609 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
610 //!
|
Chris@16
|
611 //! <b>Throws</b>: If hash_func or equal_func throw.
|
Chris@16
|
612 //!
|
Chris@16
|
613 //! <b>Note</b>: This function is used when constructing a value_type
|
Chris@16
|
614 //! is expensive and the value_type can be compared with a cheaper
|
Chris@16
|
615 //! key type. Usually this key is part of the value_type.
|
Chris@16
|
616 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
617 iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
|
Chris@16
|
618 { return table_type::find(key, hash_func, equal_func); }
|
Chris@16
|
619
|
Chris@16
|
620 //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
|
Chris@16
|
621 //! "key" or end() if that element does not exist.
|
Chris@16
|
622 //!
|
Chris@16
|
623 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
624 //!
|
Chris@16
|
625 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
626 const_iterator find(const_reference value) const
|
Chris@16
|
627 { return table_type::find(value); }
|
Chris@16
|
628
|
Chris@16
|
629 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
630 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
631 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
632 //!
|
Chris@16
|
633 //! "equal_func" must be a equality function that induces
|
Chris@16
|
634 //! the same equality as key_equal. The difference is that
|
Chris@16
|
635 //! "equal_func" compares an arbitrary key with the contained values.
|
Chris@16
|
636 //!
|
Chris@16
|
637 //! <b>Effects</b>: Finds an iterator to the first element whose key is
|
Chris@16
|
638 //! "key" according to the given hasher and equality functor or end() if
|
Chris@16
|
639 //! that element does not exist.
|
Chris@16
|
640 //!
|
Chris@16
|
641 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
642 //!
|
Chris@16
|
643 //! <b>Throws</b>: If hash_func or equal_func throw.
|
Chris@16
|
644 //!
|
Chris@16
|
645 //! <b>Note</b>: This function is used when constructing a value_type
|
Chris@16
|
646 //! is expensive and the value_type can be compared with a cheaper
|
Chris@16
|
647 //! key type. Usually this key is part of the value_type.
|
Chris@16
|
648 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
649 const_iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
|
Chris@16
|
650 { return table_type::find(key, hash_func, equal_func); }
|
Chris@16
|
651
|
Chris@16
|
652 //! <b>Effects</b>: Returns a range containing all elements with values equivalent
|
Chris@16
|
653 //! to value. Returns std::make_pair(this->end(), this->end()) if no such
|
Chris@16
|
654 //! elements exist.
|
Chris@16
|
655 //!
|
Chris@16
|
656 //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
|
Chris@16
|
657 //!
|
Chris@16
|
658 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
659 std::pair<iterator,iterator> equal_range(const_reference value)
|
Chris@16
|
660 { return table_type::equal_range(value); }
|
Chris@16
|
661
|
Chris@16
|
662 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
663 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
664 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
665 //!
|
Chris@16
|
666 //! "equal_func" must be a equality function that induces
|
Chris@16
|
667 //! the same equality as key_equal. The difference is that
|
Chris@16
|
668 //! "equal_func" compares an arbitrary key with the contained values.
|
Chris@16
|
669 //!
|
Chris@16
|
670 //! <b>Effects</b>: Returns a range containing all elements with equivalent
|
Chris@16
|
671 //! keys. Returns std::make_pair(this->end(), this->end()) if no such
|
Chris@16
|
672 //! elements exist.
|
Chris@16
|
673 //!
|
Chris@16
|
674 //! <b>Complexity</b>: Average case O(this->count(key, hash_func, hash_func)).
|
Chris@16
|
675 //! Worst case O(this->size()).
|
Chris@16
|
676 //!
|
Chris@16
|
677 //! <b>Throws</b>: If hash_func or the equal_func throw.
|
Chris@16
|
678 //!
|
Chris@16
|
679 //! <b>Note</b>: This function is used when constructing a value_type
|
Chris@16
|
680 //! is expensive and the value_type can be compared with a cheaper
|
Chris@16
|
681 //! key type. Usually this key is part of the value_type.
|
Chris@16
|
682 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
683 std::pair<iterator,iterator> equal_range(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
|
Chris@16
|
684 { return table_type::equal_range(key, hash_func, equal_func); }
|
Chris@16
|
685
|
Chris@16
|
686 //! <b>Effects</b>: Returns a range containing all elements with values equivalent
|
Chris@16
|
687 //! to value. Returns std::make_pair(this->end(), this->end()) if no such
|
Chris@16
|
688 //! elements exist.
|
Chris@16
|
689 //!
|
Chris@16
|
690 //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
|
Chris@16
|
691 //!
|
Chris@16
|
692 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
693 std::pair<const_iterator, const_iterator>
|
Chris@16
|
694 equal_range(const_reference value) const
|
Chris@16
|
695 { return table_type::equal_range(value); }
|
Chris@16
|
696
|
Chris@16
|
697 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
698 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
699 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
700 //!
|
Chris@16
|
701 //! "equal_func" must be a equality function that induces
|
Chris@16
|
702 //! the same equality as key_equal. The difference is that
|
Chris@16
|
703 //! "equal_func" compares an arbitrary key with the contained values.
|
Chris@16
|
704 //!
|
Chris@16
|
705 //! <b>Effects</b>: Returns a range containing all elements with equivalent
|
Chris@16
|
706 //! keys. Returns std::make_pair(this->end(), this->end()) if no such
|
Chris@16
|
707 //! elements exist.
|
Chris@16
|
708 //!
|
Chris@16
|
709 //! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
|
Chris@16
|
710 //! Worst case O(this->size()).
|
Chris@16
|
711 //!
|
Chris@16
|
712 //! <b>Throws</b>: If the hash_func or equal_func throw.
|
Chris@16
|
713 //!
|
Chris@16
|
714 //! <b>Note</b>: This function is used when constructing a value_type
|
Chris@16
|
715 //! is expensive and the value_type can be compared with a cheaper
|
Chris@16
|
716 //! key type. Usually this key is part of the value_type.
|
Chris@16
|
717 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
718 std::pair<const_iterator, const_iterator>
|
Chris@16
|
719 equal_range(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
|
Chris@16
|
720 { return table_type::equal_range(key, hash_func, equal_func); }
|
Chris@16
|
721
|
Chris@16
|
722 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
723 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
724 //!
|
Chris@16
|
725 //! <b>Effects</b>: Returns: a valid iterator belonging to the unordered_set
|
Chris@16
|
726 //! that points to the value
|
Chris@16
|
727 //!
|
Chris@16
|
728 //! <b>Complexity</b>: Constant.
|
Chris@16
|
729 //!
|
Chris@16
|
730 //! <b>Throws</b>: If the internal hash function throws.
|
Chris@16
|
731 iterator iterator_to(reference value)
|
Chris@16
|
732 { return table_type::iterator_to(value); }
|
Chris@16
|
733
|
Chris@16
|
734 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
735 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
736 //!
|
Chris@16
|
737 //! <b>Effects</b>: Returns: a valid const_iterator belonging to the
|
Chris@16
|
738 //! unordered_set that points to the value
|
Chris@16
|
739 //!
|
Chris@16
|
740 //! <b>Complexity</b>: Constant.
|
Chris@16
|
741 //!
|
Chris@16
|
742 //! <b>Throws</b>: If the internal hash function throws.
|
Chris@16
|
743 const_iterator iterator_to(const_reference value) const
|
Chris@16
|
744 { return table_type::iterator_to(value); }
|
Chris@16
|
745
|
Chris@16
|
746 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
747 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
748 //!
|
Chris@16
|
749 //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
|
Chris@16
|
750 //! that points to the value
|
Chris@16
|
751 //!
|
Chris@16
|
752 //! <b>Complexity</b>: Constant.
|
Chris@16
|
753 //!
|
Chris@16
|
754 //! <b>Throws</b>: Nothing.
|
Chris@16
|
755 //!
|
Chris@16
|
756 //! <b>Note</b>: This static function is available only if the <i>value traits</i>
|
Chris@16
|
757 //! is stateless.
|
Chris@16
|
758 static local_iterator s_local_iterator_to(reference value)
|
Chris@16
|
759 { return table_type::s_local_iterator_to(value); }
|
Chris@16
|
760
|
Chris@16
|
761 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
762 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
763 //!
|
Chris@16
|
764 //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
|
Chris@16
|
765 //! the unordered_set that points to the value
|
Chris@16
|
766 //!
|
Chris@16
|
767 //! <b>Complexity</b>: Constant.
|
Chris@16
|
768 //!
|
Chris@16
|
769 //! <b>Throws</b>: Nothing.
|
Chris@16
|
770 //!
|
Chris@16
|
771 //! <b>Note</b>: This static function is available only if the <i>value traits</i>
|
Chris@16
|
772 //! is stateless.
|
Chris@16
|
773 static const_local_iterator s_local_iterator_to(const_reference value)
|
Chris@16
|
774 { return table_type::s_local_iterator_to(value); }
|
Chris@16
|
775
|
Chris@16
|
776 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
777 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
778 //!
|
Chris@16
|
779 //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
|
Chris@16
|
780 //! that points to the value
|
Chris@16
|
781 //!
|
Chris@16
|
782 //! <b>Complexity</b>: Constant.
|
Chris@16
|
783 //!
|
Chris@16
|
784 //! <b>Throws</b>: Nothing.
|
Chris@16
|
785 local_iterator local_iterator_to(reference value)
|
Chris@16
|
786 { return table_type::local_iterator_to(value); }
|
Chris@16
|
787
|
Chris@16
|
788 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
789 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
790 //!
|
Chris@16
|
791 //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
|
Chris@16
|
792 //! the unordered_set that points to the value
|
Chris@16
|
793 //!
|
Chris@16
|
794 //! <b>Complexity</b>: Constant.
|
Chris@16
|
795 //!
|
Chris@16
|
796 //! <b>Throws</b>: Nothing.
|
Chris@16
|
797 const_local_iterator local_iterator_to(const_reference value) const
|
Chris@16
|
798 { return table_type::local_iterator_to(value); }
|
Chris@16
|
799
|
Chris@16
|
800 //! <b>Effects</b>: Returns the number of buckets passed in the constructor
|
Chris@16
|
801 //! or the last rehash function.
|
Chris@16
|
802 //!
|
Chris@16
|
803 //! <b>Complexity</b>: Constant.
|
Chris@16
|
804 //!
|
Chris@16
|
805 //! <b>Throws</b>: Nothing.
|
Chris@16
|
806 size_type bucket_count() const
|
Chris@16
|
807 { return table_type::bucket_count(); }
|
Chris@16
|
808
|
Chris@16
|
809 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
810 //!
|
Chris@16
|
811 //! <b>Effects</b>: Returns the number of elements in the nth bucket.
|
Chris@16
|
812 //!
|
Chris@16
|
813 //! <b>Complexity</b>: Constant.
|
Chris@16
|
814 //!
|
Chris@16
|
815 //! <b>Throws</b>: Nothing.
|
Chris@16
|
816 size_type bucket_size(size_type n) const
|
Chris@16
|
817 { return table_type::bucket_size(n); }
|
Chris@16
|
818
|
Chris@16
|
819 //! <b>Effects</b>: Returns the index of the bucket in which elements
|
Chris@16
|
820 //! with keys equivalent to k would be found, if any such element existed.
|
Chris@16
|
821 //!
|
Chris@16
|
822 //! <b>Complexity</b>: Constant.
|
Chris@16
|
823 //!
|
Chris@16
|
824 //! <b>Throws</b>: If the hash functor throws.
|
Chris@16
|
825 //!
|
Chris@16
|
826 //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
|
Chris@16
|
827 size_type bucket(const value_type& k) const
|
Chris@16
|
828 { return table_type::bucket(k); }
|
Chris@16
|
829
|
Chris@16
|
830 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
831 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
832 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
833 //!
|
Chris@16
|
834 //! <b>Effects</b>: Returns the index of the bucket in which elements
|
Chris@16
|
835 //! with keys equivalent to k would be found, if any such element existed.
|
Chris@16
|
836 //!
|
Chris@16
|
837 //! <b>Complexity</b>: Constant.
|
Chris@16
|
838 //!
|
Chris@16
|
839 //! <b>Throws</b>: If hash_func throws.
|
Chris@16
|
840 //!
|
Chris@16
|
841 //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
|
Chris@16
|
842 template<class KeyType, class KeyHasher>
|
Chris@16
|
843 size_type bucket(const KeyType& k, KeyHasher hash_func) const
|
Chris@16
|
844 { return table_type::bucket(k, hash_func); }
|
Chris@16
|
845
|
Chris@16
|
846 //! <b>Effects</b>: Returns the bucket array pointer passed in the constructor
|
Chris@16
|
847 //! or the last rehash function.
|
Chris@16
|
848 //!
|
Chris@16
|
849 //! <b>Complexity</b>: Constant.
|
Chris@16
|
850 //!
|
Chris@16
|
851 //! <b>Throws</b>: Nothing.
|
Chris@16
|
852 bucket_ptr bucket_pointer() const
|
Chris@16
|
853 { return table_type::bucket_pointer(); }
|
Chris@16
|
854
|
Chris@16
|
855 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
856 //!
|
Chris@16
|
857 //! <b>Effects</b>: Returns a local_iterator pointing to the beginning
|
Chris@16
|
858 //! of the sequence stored in the bucket n.
|
Chris@16
|
859 //!
|
Chris@16
|
860 //! <b>Complexity</b>: Constant.
|
Chris@16
|
861 //!
|
Chris@16
|
862 //! <b>Throws</b>: Nothing.
|
Chris@16
|
863 //!
|
Chris@16
|
864 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
865 //! containing all of the elements in the nth bucket.
|
Chris@16
|
866 local_iterator begin(size_type n)
|
Chris@16
|
867 { return table_type::begin(n); }
|
Chris@16
|
868
|
Chris@16
|
869 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
870 //!
|
Chris@16
|
871 //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
|
Chris@16
|
872 //! of the sequence stored in the bucket n.
|
Chris@16
|
873 //!
|
Chris@16
|
874 //! <b>Complexity</b>: Constant.
|
Chris@16
|
875 //!
|
Chris@16
|
876 //! <b>Throws</b>: Nothing.
|
Chris@16
|
877 //!
|
Chris@16
|
878 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
879 //! containing all of the elements in the nth bucket.
|
Chris@16
|
880 const_local_iterator begin(size_type n) const
|
Chris@16
|
881 { return table_type::begin(n); }
|
Chris@16
|
882
|
Chris@16
|
883 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
884 //!
|
Chris@16
|
885 //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
|
Chris@16
|
886 //! of the sequence stored in the bucket n.
|
Chris@16
|
887 //!
|
Chris@16
|
888 //! <b>Complexity</b>: Constant.
|
Chris@16
|
889 //!
|
Chris@16
|
890 //! <b>Throws</b>: Nothing.
|
Chris@16
|
891 //!
|
Chris@16
|
892 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
893 //! containing all of the elements in the nth bucket.
|
Chris@16
|
894 const_local_iterator cbegin(size_type n) const
|
Chris@16
|
895 { return table_type::cbegin(n); }
|
Chris@16
|
896
|
Chris@16
|
897 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
898 //!
|
Chris@16
|
899 //! <b>Effects</b>: Returns a local_iterator pointing to the end
|
Chris@16
|
900 //! of the sequence stored in the bucket n.
|
Chris@16
|
901 //!
|
Chris@16
|
902 //! <b>Complexity</b>: Constant.
|
Chris@16
|
903 //!
|
Chris@16
|
904 //! <b>Throws</b>: Nothing.
|
Chris@16
|
905 //!
|
Chris@16
|
906 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
907 //! containing all of the elements in the nth bucket.
|
Chris@16
|
908 local_iterator end(size_type n)
|
Chris@16
|
909 { return table_type::end(n); }
|
Chris@16
|
910
|
Chris@16
|
911 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
912 //!
|
Chris@16
|
913 //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
|
Chris@16
|
914 //! of the sequence stored in the bucket n.
|
Chris@16
|
915 //!
|
Chris@16
|
916 //! <b>Complexity</b>: Constant.
|
Chris@16
|
917 //!
|
Chris@16
|
918 //! <b>Throws</b>: Nothing.
|
Chris@16
|
919 //!
|
Chris@16
|
920 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
921 //! containing all of the elements in the nth bucket.
|
Chris@16
|
922 const_local_iterator end(size_type n) const
|
Chris@16
|
923 { return table_type::end(n); }
|
Chris@16
|
924
|
Chris@16
|
925 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
926 //!
|
Chris@16
|
927 //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
|
Chris@16
|
928 //! of the sequence stored in the bucket n.
|
Chris@16
|
929 //!
|
Chris@16
|
930 //! <b>Complexity</b>: Constant.
|
Chris@16
|
931 //!
|
Chris@16
|
932 //! <b>Throws</b>: Nothing.
|
Chris@16
|
933 //!
|
Chris@16
|
934 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
935 //! containing all of the elements in the nth bucket.
|
Chris@16
|
936 const_local_iterator cend(size_type n) const
|
Chris@16
|
937 { return table_type::cend(n); }
|
Chris@16
|
938
|
Chris@16
|
939 //! <b>Requires</b>: new_buckets must be a pointer to a new bucket array
|
Chris@16
|
940 //! or the same as the old bucket array. new_size is the length of the
|
Chris@16
|
941 //! the array pointed by new_buckets. If new_buckets == this->bucket_pointer()
|
Chris@16
|
942 //! n can be bigger or smaller than this->bucket_count().
|
Chris@16
|
943 //!
|
Chris@16
|
944 //! <b>Effects</b>: Updates the internal reference with the new bucket erases
|
Chris@16
|
945 //! the values from the old bucket and inserts then in the new one.
|
Chris@16
|
946 //!
|
Chris@16
|
947 //! If store_hash option is true, this method does not use the hash function.
|
Chris@16
|
948 //!
|
Chris@16
|
949 //! <b>Complexity</b>: Average case linear in this->size(), worst case quadratic.
|
Chris@16
|
950 //!
|
Chris@16
|
951 //! <b>Throws</b>: If the hasher functor throws. Basic guarantee.
|
Chris@16
|
952 void rehash(const bucket_traits &new_bucket_traits)
|
Chris@16
|
953 { table_type::rehash(new_bucket_traits); }
|
Chris@16
|
954
|
Chris@16
|
955 //! <b>Requires</b>:
|
Chris@16
|
956 //!
|
Chris@16
|
957 //! <b>Effects</b>:
|
Chris@16
|
958 //!
|
Chris@16
|
959 //! <b>Complexity</b>:
|
Chris@16
|
960 //!
|
Chris@16
|
961 //! <b>Throws</b>:
|
Chris@16
|
962 //!
|
Chris@16
|
963 //! <b>Note</b>: this method is only available if incremental<true> option is activated.
|
Chris@16
|
964 bool incremental_rehash(bool grow = true)
|
Chris@16
|
965 { return table_type::incremental_rehash(grow); }
|
Chris@16
|
966
|
Chris@16
|
967 //! <b>Note</b>: this method is only available if incremental<true> option is activated.
|
Chris@16
|
968 bool incremental_rehash(const bucket_traits &new_bucket_traits)
|
Chris@16
|
969 { return table_type::incremental_rehash(new_bucket_traits); }
|
Chris@16
|
970
|
Chris@16
|
971 //! <b>Requires</b>:
|
Chris@16
|
972 //!
|
Chris@16
|
973 //! <b>Effects</b>:
|
Chris@16
|
974 //!
|
Chris@16
|
975 //! <b>Complexity</b>:
|
Chris@16
|
976 //!
|
Chris@16
|
977 //! <b>Throws</b>:
|
Chris@16
|
978 size_type split_count() const
|
Chris@16
|
979 { return table_type::split_count(); }
|
Chris@16
|
980
|
Chris@16
|
981 //! <b>Effects</b>: Returns the nearest new bucket count optimized for
|
Chris@16
|
982 //! the container that is bigger than n. This suggestion can be used
|
Chris@16
|
983 //! to create bucket arrays with a size that will usually improve
|
Chris@16
|
984 //! container's performance. If such value does not exist, the
|
Chris@16
|
985 //! higher possible value is returned.
|
Chris@16
|
986 //!
|
Chris@16
|
987 //! <b>Complexity</b>: Amortized constant time.
|
Chris@16
|
988 //!
|
Chris@16
|
989 //! <b>Throws</b>: Nothing.
|
Chris@16
|
990 static size_type suggested_upper_bucket_count(size_type n)
|
Chris@16
|
991 { return table_type::suggested_upper_bucket_count(n); }
|
Chris@16
|
992
|
Chris@16
|
993 //! <b>Effects</b>: Returns the nearest new bucket count optimized for
|
Chris@16
|
994 //! the container that is smaller than n. This suggestion can be used
|
Chris@16
|
995 //! to create bucket arrays with a size that will usually improve
|
Chris@16
|
996 //! container's performance. If such value does not exist, the
|
Chris@16
|
997 //! lower possible value is returned.
|
Chris@16
|
998 //!
|
Chris@16
|
999 //! <b>Complexity</b>: Amortized constant time.
|
Chris@16
|
1000 //!
|
Chris@16
|
1001 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1002 static size_type suggested_lower_bucket_count(size_type n)
|
Chris@16
|
1003 { return table_type::suggested_lower_bucket_count(n); }
|
Chris@16
|
1004
|
Chris@16
|
1005 #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
1006 };
|
Chris@16
|
1007
|
Chris@16
|
1008 //! Helper metafunction to define an \c unordered_set that yields to the same type when the
|
Chris@16
|
1009 //! same options (either explicitly or implicitly) are used.
|
Chris@16
|
1010 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
1011 template<class T, class ...Options>
|
Chris@16
|
1012 #else
|
Chris@16
|
1013 template<class T, class O1 = void, class O2 = void
|
Chris@16
|
1014 , class O3 = void, class O4 = void
|
Chris@16
|
1015 , class O5 = void, class O6 = void
|
Chris@16
|
1016 , class O7 = void, class O8 = void
|
Chris@16
|
1017 , class O9 = void, class O10= void
|
Chris@16
|
1018 >
|
Chris@16
|
1019 #endif
|
Chris@16
|
1020 struct make_unordered_set
|
Chris@16
|
1021 {
|
Chris@16
|
1022 /// @cond
|
Chris@16
|
1023 typedef typename pack_options
|
Chris@16
|
1024 < hashtable_defaults,
|
Chris@16
|
1025 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
1026 O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
|
Chris@16
|
1027 #else
|
Chris@16
|
1028 Options...
|
Chris@16
|
1029 #endif
|
Chris@16
|
1030 >::type packed_options;
|
Chris@16
|
1031
|
Chris@16
|
1032 typedef typename detail::get_value_traits
|
Chris@16
|
1033 <T, typename packed_options::proto_value_traits>::type value_traits;
|
Chris@16
|
1034
|
Chris@101
|
1035 typedef typename make_bucket_traits
|
Chris@101
|
1036 <T, true, packed_options>::type bucket_traits;
|
Chris@16
|
1037
|
Chris@16
|
1038 typedef unordered_set_impl
|
Chris@16
|
1039 < value_traits
|
Chris@16
|
1040 , typename packed_options::hash
|
Chris@16
|
1041 , typename packed_options::equal
|
Chris@16
|
1042 , typename packed_options::size_type
|
Chris@101
|
1043 , bucket_traits
|
Chris@16
|
1044 , (std::size_t(true)*hash_bool_flags::unique_keys_pos)
|
Chris@16
|
1045 | (std::size_t(packed_options::constant_time_size)*hash_bool_flags::constant_time_size_pos)
|
Chris@16
|
1046 | (std::size_t(packed_options::power_2_buckets)*hash_bool_flags::power_2_buckets_pos)
|
Chris@16
|
1047 | (std::size_t(packed_options::cache_begin)*hash_bool_flags::cache_begin_pos)
|
Chris@16
|
1048 | (std::size_t(packed_options::compare_hash)*hash_bool_flags::compare_hash_pos)
|
Chris@16
|
1049 | (std::size_t(packed_options::incremental)*hash_bool_flags::incremental_pos)
|
Chris@16
|
1050 > implementation_defined;
|
Chris@16
|
1051
|
Chris@16
|
1052 /// @endcond
|
Chris@16
|
1053 typedef implementation_defined type;
|
Chris@16
|
1054 };
|
Chris@16
|
1055
|
Chris@16
|
1056 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
1057
|
Chris@16
|
1058 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
1059 template<class T, class O1, class O2, class O3, class O4, class O5, class O6, class O7, class O8, class O9, class O10>
|
Chris@16
|
1060 #else
|
Chris@16
|
1061 template<class T, class ...Options>
|
Chris@16
|
1062 #endif
|
Chris@16
|
1063 class unordered_set
|
Chris@16
|
1064 : public make_unordered_set<T,
|
Chris@16
|
1065 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
1066 O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
|
Chris@16
|
1067 #else
|
Chris@16
|
1068 Options...
|
Chris@16
|
1069 #endif
|
Chris@16
|
1070 >::type
|
Chris@16
|
1071 {
|
Chris@16
|
1072 typedef typename make_unordered_set
|
Chris@16
|
1073 <T,
|
Chris@16
|
1074 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
1075 O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
|
Chris@16
|
1076 #else
|
Chris@16
|
1077 Options...
|
Chris@16
|
1078 #endif
|
Chris@16
|
1079 >::type Base;
|
Chris@16
|
1080
|
Chris@16
|
1081 //Assert if passed value traits are compatible with the type
|
Chris@16
|
1082 BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
|
Chris@16
|
1083 BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_set)
|
Chris@16
|
1084
|
Chris@16
|
1085 public:
|
Chris@16
|
1086 typedef typename Base::value_traits value_traits;
|
Chris@16
|
1087 typedef typename Base::bucket_traits bucket_traits;
|
Chris@16
|
1088 typedef typename Base::iterator iterator;
|
Chris@16
|
1089 typedef typename Base::const_iterator const_iterator;
|
Chris@16
|
1090 typedef typename Base::bucket_ptr bucket_ptr;
|
Chris@16
|
1091 typedef typename Base::size_type size_type;
|
Chris@16
|
1092 typedef typename Base::hasher hasher;
|
Chris@16
|
1093 typedef typename Base::key_equal key_equal;
|
Chris@16
|
1094
|
Chris@16
|
1095 explicit unordered_set ( const bucket_traits &b_traits
|
Chris@16
|
1096 , const hasher & hash_func = hasher()
|
Chris@16
|
1097 , const key_equal &equal_func = key_equal()
|
Chris@16
|
1098 , const value_traits &v_traits = value_traits())
|
Chris@16
|
1099 : Base(b_traits, hash_func, equal_func, v_traits)
|
Chris@16
|
1100 {}
|
Chris@16
|
1101
|
Chris@16
|
1102 template<class Iterator>
|
Chris@16
|
1103 unordered_set ( Iterator b
|
Chris@16
|
1104 , Iterator e
|
Chris@16
|
1105 , const bucket_traits &b_traits
|
Chris@16
|
1106 , const hasher & hash_func = hasher()
|
Chris@16
|
1107 , const key_equal &equal_func = key_equal()
|
Chris@16
|
1108 , const value_traits &v_traits = value_traits())
|
Chris@16
|
1109 : Base(b, e, b_traits, hash_func, equal_func, v_traits)
|
Chris@16
|
1110 {}
|
Chris@16
|
1111
|
Chris@16
|
1112 unordered_set(BOOST_RV_REF(unordered_set) x)
|
Chris@101
|
1113 : Base(BOOST_MOVE_BASE(Base, x))
|
Chris@16
|
1114 {}
|
Chris@16
|
1115
|
Chris@16
|
1116 unordered_set& operator=(BOOST_RV_REF(unordered_set) x)
|
Chris@101
|
1117 { return static_cast<unordered_set&>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
Chris@16
|
1118 };
|
Chris@16
|
1119
|
Chris@16
|
1120 #endif
|
Chris@16
|
1121
|
Chris@16
|
1122
|
Chris@16
|
1123 //! The class template unordered_multiset is an intrusive container, that mimics most of
|
Chris@16
|
1124 //! the interface of std::tr1::unordered_multiset as described in the C++ TR1.
|
Chris@16
|
1125 //!
|
Chris@16
|
1126 //! unordered_multiset is a semi-intrusive container: each object to be stored in the
|
Chris@16
|
1127 //! container must contain a proper hook, but the container also needs
|
Chris@16
|
1128 //! additional auxiliary memory to work: unordered_multiset needs a pointer to an array
|
Chris@16
|
1129 //! of type `bucket_type` to be passed in the constructor. This bucket array must
|
Chris@16
|
1130 //! have at least the same lifetime as the container. This makes the use of
|
Chris@16
|
1131 //! unordered_multiset more complicated than purely intrusive containers.
|
Chris@16
|
1132 //! `bucket_type` is default-constructible, copyable and assignable
|
Chris@16
|
1133 //!
|
Chris@16
|
1134 //! The template parameter \c T is the type to be managed by the container.
|
Chris@16
|
1135 //! The user can specify additional options and if no options are provided
|
Chris@16
|
1136 //! default options are used.
|
Chris@16
|
1137 //!
|
Chris@16
|
1138 //! The container supports the following options:
|
Chris@16
|
1139 //! \c base_hook<>/member_hook<>/value_traits<>,
|
Chris@16
|
1140 //! \c constant_time_size<>, \c size_type<>, \c hash<> and \c equal<>
|
Chris@16
|
1141 //! \c bucket_traits<>, \c power_2_buckets<> and \c cache_begin<>.
|
Chris@16
|
1142 //!
|
Chris@16
|
1143 //! unordered_multiset only provides forward iterators but it provides 4 iterator types:
|
Chris@16
|
1144 //! iterator and const_iterator to navigate through the whole container and
|
Chris@16
|
1145 //! local_iterator and const_local_iterator to navigate through the values
|
Chris@16
|
1146 //! stored in a single bucket. Local iterators are faster and smaller.
|
Chris@16
|
1147 //!
|
Chris@16
|
1148 //! It's not recommended to use non constant-time size unordered_multisets because several
|
Chris@16
|
1149 //! key functions, like "empty()", become non-constant time functions. Non
|
Chris@16
|
1150 //! constant-time size unordered_multisets are mainly provided to support auto-unlink hooks.
|
Chris@16
|
1151 //!
|
Chris@16
|
1152 //! unordered_multiset, unlike std::unordered_set, does not make automatic rehashings nor
|
Chris@16
|
1153 //! offers functions related to a load factor. Rehashing can be explicitly requested
|
Chris@16
|
1154 //! and the user must provide a new bucket array that will be used from that moment.
|
Chris@16
|
1155 //!
|
Chris@16
|
1156 //! Since no automatic rehashing is done, iterators are never invalidated when
|
Chris@16
|
1157 //! inserting or erasing elements. Iterators are only invalidated when rehasing.
|
Chris@16
|
1158 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
1159 template<class T, class ...Options>
|
Chris@16
|
1160 #else
|
Chris@16
|
1161 template<class ValueTraits, class Hash, class Equal, class SizeType, class BucketTraits, std::size_t BoolFlags>
|
Chris@16
|
1162 #endif
|
Chris@16
|
1163 class unordered_multiset_impl
|
Chris@16
|
1164 : public hashtable_impl<ValueTraits, Hash, Equal, SizeType, BucketTraits, BoolFlags>
|
Chris@16
|
1165 {
|
Chris@16
|
1166 /// @cond
|
Chris@16
|
1167 private:
|
Chris@16
|
1168 typedef hashtable_impl<ValueTraits, Hash, Equal, SizeType, BucketTraits, BoolFlags> table_type;
|
Chris@16
|
1169 /// @endcond
|
Chris@16
|
1170
|
Chris@16
|
1171 //Movable
|
Chris@16
|
1172 BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_multiset_impl)
|
Chris@16
|
1173
|
Chris@16
|
1174 typedef table_type implementation_defined;
|
Chris@16
|
1175
|
Chris@16
|
1176 public:
|
Chris@16
|
1177 typedef typename implementation_defined::value_type value_type;
|
Chris@16
|
1178 typedef typename implementation_defined::value_traits value_traits;
|
Chris@16
|
1179 typedef typename implementation_defined::bucket_traits bucket_traits;
|
Chris@16
|
1180 typedef typename implementation_defined::pointer pointer;
|
Chris@16
|
1181 typedef typename implementation_defined::const_pointer const_pointer;
|
Chris@16
|
1182 typedef typename implementation_defined::reference reference;
|
Chris@16
|
1183 typedef typename implementation_defined::const_reference const_reference;
|
Chris@16
|
1184 typedef typename implementation_defined::difference_type difference_type;
|
Chris@16
|
1185 typedef typename implementation_defined::size_type size_type;
|
Chris@16
|
1186 typedef typename implementation_defined::key_type key_type;
|
Chris@16
|
1187 typedef typename implementation_defined::key_equal key_equal;
|
Chris@16
|
1188 typedef typename implementation_defined::hasher hasher;
|
Chris@16
|
1189 typedef typename implementation_defined::bucket_type bucket_type;
|
Chris@16
|
1190 typedef typename implementation_defined::bucket_ptr bucket_ptr;
|
Chris@16
|
1191 typedef typename implementation_defined::iterator iterator;
|
Chris@16
|
1192 typedef typename implementation_defined::const_iterator const_iterator;
|
Chris@16
|
1193 typedef typename implementation_defined::insert_commit_data insert_commit_data;
|
Chris@16
|
1194 typedef typename implementation_defined::local_iterator local_iterator;
|
Chris@16
|
1195 typedef typename implementation_defined::const_local_iterator const_local_iterator;
|
Chris@16
|
1196 typedef typename implementation_defined::node_traits node_traits;
|
Chris@16
|
1197 typedef typename implementation_defined::node node;
|
Chris@16
|
1198 typedef typename implementation_defined::node_ptr node_ptr;
|
Chris@16
|
1199 typedef typename implementation_defined::const_node_ptr const_node_ptr;
|
Chris@16
|
1200 typedef typename implementation_defined::node_algorithms node_algorithms;
|
Chris@16
|
1201
|
Chris@16
|
1202 public:
|
Chris@16
|
1203
|
Chris@16
|
1204 //! <b>Requires</b>: buckets must not be being used by any other resource.
|
Chris@16
|
1205 //!
|
Chris@16
|
1206 //! <b>Effects</b>: Constructs an empty unordered_multiset, storing a reference
|
Chris@16
|
1207 //! to the bucket array and copies of the hasher and equal functors.
|
Chris@16
|
1208 //!
|
Chris@16
|
1209 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1210 //!
|
Chris@16
|
1211 //! <b>Throws</b>: If value_traits::node_traits::node
|
Chris@16
|
1212 //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
Chris@16
|
1213 //! or the copy constructor or invocation of Hash or Equal throws.
|
Chris@16
|
1214 //!
|
Chris@16
|
1215 //! <b>Notes</b>: buckets array must be disposed only after
|
Chris@16
|
1216 //! *this is disposed.
|
Chris@16
|
1217 explicit unordered_multiset_impl ( const bucket_traits &b_traits
|
Chris@16
|
1218 , const hasher & hash_func = hasher()
|
Chris@16
|
1219 , const key_equal &equal_func = key_equal()
|
Chris@16
|
1220 , const value_traits &v_traits = value_traits())
|
Chris@16
|
1221 : table_type(b_traits, hash_func, equal_func, v_traits)
|
Chris@16
|
1222 {}
|
Chris@16
|
1223
|
Chris@16
|
1224 //! <b>Requires</b>: buckets must not be being used by any other resource
|
Chris@16
|
1225 //! and Dereferencing iterator must yield an lvalue of type value_type.
|
Chris@16
|
1226 //!
|
Chris@16
|
1227 //! <b>Effects</b>: Constructs an empty unordered_multiset and inserts elements from
|
Chris@16
|
1228 //! [b, e).
|
Chris@16
|
1229 //!
|
Chris@101
|
1230 //! <b>Complexity</b>: If N is distance(b, e): Average case is O(N)
|
Chris@16
|
1231 //! (with a good hash function and with buckets_len >= N),worst case O(N2).
|
Chris@16
|
1232 //!
|
Chris@16
|
1233 //! <b>Throws</b>: If value_traits::node_traits::node
|
Chris@16
|
1234 //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
Chris@16
|
1235 //! or the copy constructor or invocation of hasher or key_equal throws.
|
Chris@16
|
1236 //!
|
Chris@16
|
1237 //! <b>Notes</b>: buckets array must be disposed only after
|
Chris@16
|
1238 //! *this is disposed.
|
Chris@16
|
1239 template<class Iterator>
|
Chris@16
|
1240 unordered_multiset_impl ( Iterator b
|
Chris@16
|
1241 , Iterator e
|
Chris@16
|
1242 , const bucket_traits &b_traits
|
Chris@16
|
1243 , const hasher & hash_func = hasher()
|
Chris@16
|
1244 , const key_equal &equal_func = key_equal()
|
Chris@16
|
1245 , const value_traits &v_traits = value_traits())
|
Chris@16
|
1246 : table_type(b_traits, hash_func, equal_func, v_traits)
|
Chris@16
|
1247 { table_type::insert_equal(b, e); }
|
Chris@16
|
1248
|
Chris@16
|
1249 //! <b>Effects</b>: to-do
|
Chris@16
|
1250 //!
|
Chris@16
|
1251 unordered_multiset_impl(BOOST_RV_REF(unordered_multiset_impl) x)
|
Chris@101
|
1252 : table_type(BOOST_MOVE_BASE(table_type, x))
|
Chris@16
|
1253 {}
|
Chris@16
|
1254
|
Chris@16
|
1255 //! <b>Effects</b>: to-do
|
Chris@16
|
1256 //!
|
Chris@16
|
1257 unordered_multiset_impl& operator=(BOOST_RV_REF(unordered_multiset_impl) x)
|
Chris@101
|
1258 { return static_cast<unordered_multiset_impl&>(table_type::operator=(BOOST_MOVE_BASE(table_type, x))); }
|
Chris@16
|
1259
|
Chris@16
|
1260 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
1261
|
Chris@16
|
1262 //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_multiset
|
Chris@16
|
1263 //! are not deleted (i.e. no destructors are called).
|
Chris@16
|
1264 //!
|
Chris@16
|
1265 //! <b>Complexity</b>: Linear to the number of elements in the unordered_multiset, if
|
Chris@16
|
1266 //! it's a safe-mode or auto-unlink value. Otherwise constant.
|
Chris@16
|
1267 //!
|
Chris@16
|
1268 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1269 ~unordered_multiset_impl()
|
Chris@16
|
1270 {}
|
Chris@16
|
1271
|
Chris@16
|
1272 //! <b>Effects</b>: Returns an iterator pointing to the beginning of the unordered_multiset.
|
Chris@16
|
1273 //!
|
Chris@16
|
1274 //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
|
Chris@16
|
1275 //! constant time with worst case (empty unordered_set) O(this->bucket_count())
|
Chris@16
|
1276 //!
|
Chris@16
|
1277 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1278 iterator begin()
|
Chris@16
|
1279 { return table_type::begin(); }
|
Chris@16
|
1280
|
Chris@16
|
1281 //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
|
Chris@16
|
1282 //! of the unordered_multiset.
|
Chris@16
|
1283 //!
|
Chris@16
|
1284 //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
|
Chris@16
|
1285 //! constant time with worst case (empty unordered_set) O(this->bucket_count())
|
Chris@16
|
1286 //!
|
Chris@16
|
1287 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1288 const_iterator begin() const
|
Chris@16
|
1289 { return table_type::begin(); }
|
Chris@16
|
1290
|
Chris@16
|
1291 //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
|
Chris@16
|
1292 //! of the unordered_multiset.
|
Chris@16
|
1293 //!
|
Chris@16
|
1294 //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
|
Chris@16
|
1295 //! constant time with worst case (empty unordered_set) O(this->bucket_count())
|
Chris@16
|
1296 //!
|
Chris@16
|
1297 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1298 const_iterator cbegin() const
|
Chris@16
|
1299 { return table_type::cbegin(); }
|
Chris@16
|
1300
|
Chris@16
|
1301 //! <b>Effects</b>: Returns an iterator pointing to the end of the unordered_multiset.
|
Chris@16
|
1302 //!
|
Chris@16
|
1303 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1304 //!
|
Chris@16
|
1305 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1306 iterator end()
|
Chris@16
|
1307 { return table_type::end(); }
|
Chris@16
|
1308
|
Chris@16
|
1309 //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_multiset.
|
Chris@16
|
1310 //!
|
Chris@16
|
1311 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1312 //!
|
Chris@16
|
1313 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1314 const_iterator end() const
|
Chris@16
|
1315 { return table_type::end(); }
|
Chris@16
|
1316
|
Chris@16
|
1317 //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_multiset.
|
Chris@16
|
1318 //!
|
Chris@16
|
1319 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1320 //!
|
Chris@16
|
1321 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1322 const_iterator cend() const
|
Chris@16
|
1323 { return table_type::cend(); }
|
Chris@16
|
1324
|
Chris@16
|
1325 //! <b>Effects</b>: Returns the hasher object used by the unordered_set.
|
Chris@16
|
1326 //!
|
Chris@16
|
1327 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1328 //!
|
Chris@16
|
1329 //! <b>Throws</b>: If hasher copy-constructor throws.
|
Chris@16
|
1330 hasher hash_function() const
|
Chris@16
|
1331 { return table_type::hash_function(); }
|
Chris@16
|
1332
|
Chris@16
|
1333 //! <b>Effects</b>: Returns the key_equal object used by the unordered_multiset.
|
Chris@16
|
1334 //!
|
Chris@16
|
1335 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1336 //!
|
Chris@16
|
1337 //! <b>Throws</b>: If key_equal copy-constructor throws.
|
Chris@16
|
1338 key_equal key_eq() const
|
Chris@16
|
1339 { return table_type::key_eq(); }
|
Chris@16
|
1340
|
Chris@16
|
1341 //! <b>Effects</b>: Returns true if the container is empty.
|
Chris@16
|
1342 //!
|
Chris@16
|
1343 //! <b>Complexity</b>: if constant-time size and cache_last options are disabled,
|
Chris@16
|
1344 //! average constant time (worst case, with empty() == true: O(this->bucket_count()).
|
Chris@16
|
1345 //! Otherwise constant.
|
Chris@16
|
1346 //!
|
Chris@16
|
1347 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1348 bool empty() const
|
Chris@16
|
1349 { return table_type::empty(); }
|
Chris@16
|
1350
|
Chris@16
|
1351 //! <b>Effects</b>: Returns the number of elements stored in the unordered_multiset.
|
Chris@16
|
1352 //!
|
Chris@16
|
1353 //! <b>Complexity</b>: Linear to elements contained in *this if
|
Chris@16
|
1354 //! constant-time size option is disabled. Constant-time otherwise.
|
Chris@16
|
1355 //!
|
Chris@16
|
1356 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1357 size_type size() const
|
Chris@16
|
1358 { return table_type::size(); }
|
Chris@16
|
1359
|
Chris@16
|
1360 //! <b>Requires</b>: the hasher and the equality function unqualified swap
|
Chris@16
|
1361 //! call should not throw.
|
Chris@16
|
1362 //!
|
Chris@16
|
1363 //! <b>Effects</b>: Swaps the contents of two unordered_multisets.
|
Chris@16
|
1364 //! Swaps also the contained bucket array and equality and hasher functors.
|
Chris@16
|
1365 //!
|
Chris@16
|
1366 //!
|
Chris@16
|
1367 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1368 //!
|
Chris@16
|
1369 //! <b>Throws</b>: If the swap() call for the comparison or hash functors
|
Chris@16
|
1370 //! found using ADL throw. Basic guarantee.
|
Chris@16
|
1371 void swap(unordered_multiset_impl& other)
|
Chris@16
|
1372 { table_type::swap(other.table_); }
|
Chris@16
|
1373
|
Chris@16
|
1374 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
1375 //! Cloner should yield to nodes that compare equal and produce the same
|
Chris@16
|
1376 //! hash than the original node.
|
Chris@16
|
1377 //!
|
Chris@16
|
1378 //! <b>Effects</b>: Erases all the elements from *this
|
Chris@16
|
1379 //! calling Disposer::operator()(pointer), clones all the
|
Chris@16
|
1380 //! elements from src calling Cloner::operator()(const_reference )
|
Chris@16
|
1381 //! and inserts them on *this. The hash function and the equality
|
Chris@16
|
1382 //! predicate are copied from the source.
|
Chris@16
|
1383 //!
|
Chris@16
|
1384 //! If store_hash option is true, this method does not use the hash function.
|
Chris@16
|
1385 //!
|
Chris@16
|
1386 //! If any operation throws, all cloned elements are unlinked and disposed
|
Chris@16
|
1387 //! calling Disposer::operator()(pointer).
|
Chris@16
|
1388 //!
|
Chris@16
|
1389 //! <b>Complexity</b>: Linear to erased plus inserted elements.
|
Chris@16
|
1390 //!
|
Chris@16
|
1391 //! <b>Throws</b>: If cloner or hasher throw or hash or equality predicate copying
|
Chris@16
|
1392 //! throws. Basic guarantee.
|
Chris@16
|
1393 template <class Cloner, class Disposer>
|
Chris@16
|
1394 void clone_from(const unordered_multiset_impl &src, Cloner cloner, Disposer disposer)
|
Chris@16
|
1395 { table_type::clone_from(src.table_, cloner, disposer); }
|
Chris@16
|
1396
|
Chris@16
|
1397 #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
1398
|
Chris@16
|
1399 //! <b>Requires</b>: value must be an lvalue
|
Chris@16
|
1400 //!
|
Chris@16
|
1401 //! <b>Effects</b>: Inserts value into the unordered_multiset.
|
Chris@16
|
1402 //!
|
Chris@16
|
1403 //! <b>Returns</b>: An iterator to the new inserted value.
|
Chris@16
|
1404 //!
|
Chris@16
|
1405 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
1406 //!
|
Chris@16
|
1407 //! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
|
Chris@16
|
1408 //!
|
Chris@16
|
1409 //! <b>Note</b>: Does not affect the validity of iterators and references.
|
Chris@16
|
1410 //! No copy-constructors are called.
|
Chris@16
|
1411 iterator insert(reference value)
|
Chris@16
|
1412 { return table_type::insert_equal(value); }
|
Chris@16
|
1413
|
Chris@16
|
1414 //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
|
Chris@16
|
1415 //! of type value_type.
|
Chris@16
|
1416 //!
|
Chris@16
|
1417 //! <b>Effects</b>: Equivalent to this->insert(t) for each element in [b, e).
|
Chris@16
|
1418 //!
|
Chris@16
|
1419 //! <b>Complexity</b>: Average case is O(N), where N is the
|
Chris@16
|
1420 //! size of the range.
|
Chris@16
|
1421 //!
|
Chris@16
|
1422 //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
|
Chris@16
|
1423 //!
|
Chris@16
|
1424 //! <b>Note</b>: Does not affect the validity of iterators and references.
|
Chris@16
|
1425 //! No copy-constructors are called.
|
Chris@16
|
1426 template<class Iterator>
|
Chris@16
|
1427 void insert(Iterator b, Iterator e)
|
Chris@16
|
1428 { table_type::insert_equal(b, e); }
|
Chris@16
|
1429
|
Chris@16
|
1430 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
1431
|
Chris@16
|
1432 //! <b>Effects</b>: Erases the element pointed to by i.
|
Chris@16
|
1433 //!
|
Chris@16
|
1434 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
1435 //!
|
Chris@16
|
1436 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1437 //!
|
Chris@16
|
1438 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
1439 //! to the erased element. No destructors are called.
|
Chris@16
|
1440 void erase(const_iterator i)
|
Chris@16
|
1441 { table_type::erase(i); }
|
Chris@16
|
1442
|
Chris@16
|
1443 //! <b>Effects</b>: Erases the range pointed to by b end e.
|
Chris@16
|
1444 //!
|
Chris@101
|
1445 //! <b>Complexity</b>: Average case O(distance(b, e)),
|
Chris@16
|
1446 //! worst case O(this->size()).
|
Chris@16
|
1447 //!
|
Chris@16
|
1448 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1449 //!
|
Chris@16
|
1450 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
1451 //! to the erased elements. No destructors are called.
|
Chris@16
|
1452 void erase(const_iterator b, const_iterator e)
|
Chris@16
|
1453 { table_type::erase(b, e); }
|
Chris@16
|
1454
|
Chris@16
|
1455 //! <b>Effects</b>: Erases all the elements with the given value.
|
Chris@16
|
1456 //!
|
Chris@16
|
1457 //! <b>Returns</b>: The number of erased elements.
|
Chris@16
|
1458 //!
|
Chris@16
|
1459 //! <b>Complexity</b>: Average case O(this->count(value)).
|
Chris@16
|
1460 //! Worst case O(this->size()).
|
Chris@16
|
1461 //!
|
Chris@16
|
1462 //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
|
Chris@16
|
1463 //!
|
Chris@16
|
1464 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
1465 //! to the erased elements. No destructors are called.
|
Chris@16
|
1466 size_type erase(const_reference value)
|
Chris@16
|
1467 { return table_type::erase(value); }
|
Chris@16
|
1468
|
Chris@16
|
1469 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
1470 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
1471 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
1472 //!
|
Chris@16
|
1473 //! "key_value_equal" must be a equality function that induces
|
Chris@16
|
1474 //! the same equality as key_equal. The difference is that
|
Chris@16
|
1475 //! "key_value_equal" compares an arbitrary key with the contained values.
|
Chris@16
|
1476 //!
|
Chris@16
|
1477 //! <b>Effects</b>: Erases all the elements that have the same hash and
|
Chris@16
|
1478 //! compare equal with the given key.
|
Chris@16
|
1479 //!
|
Chris@16
|
1480 //! <b>Returns</b>: The number of erased elements.
|
Chris@16
|
1481 //!
|
Chris@16
|
1482 //! <b>Complexity</b>: Average case O(this->count(value)).
|
Chris@16
|
1483 //! Worst case O(this->size()).
|
Chris@16
|
1484 //!
|
Chris@16
|
1485 //! <b>Throws</b>: If the hash_func or the equal_func functors throws.
|
Chris@16
|
1486 //! Basic guarantee.
|
Chris@16
|
1487 //!
|
Chris@16
|
1488 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
1489 //! to the erased elements. No destructors are called.
|
Chris@16
|
1490 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
1491 size_type erase(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
|
Chris@16
|
1492 { return table_type::erase(key, hash_func, equal_func); }
|
Chris@16
|
1493
|
Chris@16
|
1494 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
1495 //!
|
Chris@16
|
1496 //! <b>Effects</b>: Erases the element pointed to by i.
|
Chris@16
|
1497 //! Disposer::operator()(pointer) is called for the removed element.
|
Chris@16
|
1498 //!
|
Chris@16
|
1499 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
1500 //!
|
Chris@16
|
1501 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1502 //!
|
Chris@16
|
1503 //! <b>Note</b>: Invalidates the iterators
|
Chris@16
|
1504 //! to the erased elements.
|
Chris@16
|
1505 template<class Disposer>
|
Chris@16
|
1506 void erase_and_dispose(const_iterator i, Disposer disposer
|
Chris@16
|
1507 /// @cond
|
Chris@16
|
1508 , typename detail::enable_if_c<!detail::is_convertible<Disposer, const_iterator>::value >::type * = 0
|
Chris@16
|
1509 /// @endcond
|
Chris@16
|
1510 )
|
Chris@16
|
1511 { table_type::erase_and_dispose(i, disposer); }
|
Chris@16
|
1512
|
Chris@16
|
1513 #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
1514 template<class Disposer>
|
Chris@16
|
1515 void erase_and_dispose(const_iterator i, Disposer disposer)
|
Chris@16
|
1516 { this->erase_and_dispose(const_iterator(i), disposer); }
|
Chris@16
|
1517 #endif
|
Chris@16
|
1518
|
Chris@16
|
1519 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
1520 //!
|
Chris@16
|
1521 //! <b>Effects</b>: Erases the range pointed to by b end e.
|
Chris@16
|
1522 //! Disposer::operator()(pointer) is called for the removed elements.
|
Chris@16
|
1523 //!
|
Chris@101
|
1524 //! <b>Complexity</b>: Average case O(distance(b, e)),
|
Chris@16
|
1525 //! worst case O(this->size()).
|
Chris@16
|
1526 //!
|
Chris@16
|
1527 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1528 //!
|
Chris@16
|
1529 //! <b>Note</b>: Invalidates the iterators
|
Chris@16
|
1530 //! to the erased elements.
|
Chris@16
|
1531 template<class Disposer>
|
Chris@16
|
1532 void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
|
Chris@16
|
1533 { table_type::erase_and_dispose(b, e, disposer); }
|
Chris@16
|
1534
|
Chris@16
|
1535 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
1536 //!
|
Chris@16
|
1537 //! <b>Effects</b>: Erases all the elements with the given value.
|
Chris@16
|
1538 //! Disposer::operator()(pointer) is called for the removed elements.
|
Chris@16
|
1539 //!
|
Chris@16
|
1540 //! <b>Returns</b>: The number of erased elements.
|
Chris@16
|
1541 //!
|
Chris@16
|
1542 //! <b>Complexity</b>: Average case O(this->count(value)).
|
Chris@16
|
1543 //! Worst case O(this->size()).
|
Chris@16
|
1544 //!
|
Chris@16
|
1545 //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
|
Chris@16
|
1546 //!
|
Chris@16
|
1547 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
1548 //! to the erased elements. No destructors are called.
|
Chris@16
|
1549 template<class Disposer>
|
Chris@16
|
1550 size_type erase_and_dispose(const_reference value, Disposer disposer)
|
Chris@16
|
1551 { return table_type::erase_and_dispose(value, disposer); }
|
Chris@16
|
1552
|
Chris@16
|
1553 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
1554 //!
|
Chris@16
|
1555 //! <b>Effects</b>: Erases all the elements with the given key.
|
Chris@16
|
1556 //! according to the comparison functor "equal_func".
|
Chris@16
|
1557 //! Disposer::operator()(pointer) is called for the removed elements.
|
Chris@16
|
1558 //!
|
Chris@16
|
1559 //! <b>Returns</b>: The number of erased elements.
|
Chris@16
|
1560 //!
|
Chris@16
|
1561 //! <b>Complexity</b>: Average case O(this->count(value)).
|
Chris@16
|
1562 //! Worst case O(this->size()).
|
Chris@16
|
1563 //!
|
Chris@16
|
1564 //! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
|
Chris@16
|
1565 //!
|
Chris@16
|
1566 //! <b>Note</b>: Invalidates the iterators
|
Chris@16
|
1567 //! to the erased elements.
|
Chris@16
|
1568 template<class KeyType, class KeyHasher, class KeyValueEqual, class Disposer>
|
Chris@16
|
1569 size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func, Disposer disposer)
|
Chris@16
|
1570 { return table_type::erase_and_dispose(key, hash_func, equal_func, disposer); }
|
Chris@16
|
1571
|
Chris@16
|
1572 //! <b>Effects</b>: Erases all the elements of the container.
|
Chris@16
|
1573 //!
|
Chris@16
|
1574 //! <b>Complexity</b>: Linear to the number of elements on the container.
|
Chris@16
|
1575 //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
|
Chris@16
|
1576 //!
|
Chris@16
|
1577 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1578 //!
|
Chris@16
|
1579 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
1580 //! to the erased elements. No destructors are called.
|
Chris@16
|
1581 void clear()
|
Chris@16
|
1582 { return table_type::clear(); }
|
Chris@16
|
1583
|
Chris@16
|
1584 //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
|
Chris@16
|
1585 //!
|
Chris@16
|
1586 //! <b>Effects</b>: Erases all the elements of the container.
|
Chris@16
|
1587 //!
|
Chris@16
|
1588 //! <b>Complexity</b>: Linear to the number of elements on the container.
|
Chris@16
|
1589 //! Disposer::operator()(pointer) is called for the removed elements.
|
Chris@16
|
1590 //!
|
Chris@16
|
1591 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1592 //!
|
Chris@16
|
1593 //! <b>Note</b>: Invalidates the iterators (but not the references)
|
Chris@16
|
1594 //! to the erased elements. No destructors are called.
|
Chris@16
|
1595 template<class Disposer>
|
Chris@16
|
1596 void clear_and_dispose(Disposer disposer)
|
Chris@16
|
1597 { return table_type::clear_and_dispose(disposer); }
|
Chris@16
|
1598
|
Chris@16
|
1599 //! <b>Effects</b>: Returns the number of contained elements with the given key
|
Chris@16
|
1600 //!
|
Chris@16
|
1601 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
1602 //!
|
Chris@16
|
1603 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1604 size_type count(const_reference value) const
|
Chris@16
|
1605 { return table_type::count(value); }
|
Chris@16
|
1606
|
Chris@16
|
1607 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
1608 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
1609 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
1610 //!
|
Chris@16
|
1611 //! "key_value_equal" must be a equality function that induces
|
Chris@16
|
1612 //! the same equality as key_equal. The difference is that
|
Chris@16
|
1613 //! "key_value_equal" compares an arbitrary key with the contained values.
|
Chris@16
|
1614 //!
|
Chris@16
|
1615 //! <b>Effects</b>: Returns the number of contained elements with the given key
|
Chris@16
|
1616 //!
|
Chris@16
|
1617 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
1618 //!
|
Chris@16
|
1619 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1620 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
1621 size_type count(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
|
Chris@16
|
1622 { return table_type::count(key, hash_func, equal_func); }
|
Chris@16
|
1623
|
Chris@16
|
1624 //! <b>Effects</b>: Finds an iterator to the first element whose value is
|
Chris@16
|
1625 //! "value" or end() if that element does not exist.
|
Chris@16
|
1626 //!
|
Chris@16
|
1627 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
1628 //!
|
Chris@16
|
1629 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1630 iterator find(const_reference value)
|
Chris@16
|
1631 { return table_type::find(value); }
|
Chris@16
|
1632
|
Chris@16
|
1633 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
1634 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
1635 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
1636 //!
|
Chris@16
|
1637 //! "key_value_equal" must be a equality function that induces
|
Chris@16
|
1638 //! the same equality as key_equal. The difference is that
|
Chris@16
|
1639 //! "key_value_equal" compares an arbitrary key with the contained values.
|
Chris@16
|
1640 //!
|
Chris@16
|
1641 //! <b>Effects</b>: Finds an iterator to the first element whose key is
|
Chris@16
|
1642 //! "key" according to the given hasher and equality functor or end() if
|
Chris@16
|
1643 //! that element does not exist.
|
Chris@16
|
1644 //!
|
Chris@16
|
1645 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
1646 //!
|
Chris@16
|
1647 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1648 //!
|
Chris@16
|
1649 //! <b>Note</b>: This function is used when constructing a value_type
|
Chris@16
|
1650 //! is expensive and the value_type can be compared with a cheaper
|
Chris@16
|
1651 //! key type. Usually this key is part of the value_type.
|
Chris@16
|
1652 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
1653 iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
|
Chris@16
|
1654 { return table_type::find(key, hash_func, equal_func); }
|
Chris@16
|
1655
|
Chris@16
|
1656 //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
|
Chris@16
|
1657 //! "key" or end() if that element does not exist.
|
Chris@16
|
1658 //!
|
Chris@16
|
1659 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
1660 //!
|
Chris@16
|
1661 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1662 const_iterator find(const_reference value) const
|
Chris@16
|
1663 { return table_type::find(value); }
|
Chris@16
|
1664
|
Chris@16
|
1665 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
1666 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
1667 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
1668 //!
|
Chris@16
|
1669 //! "key_value_equal" must be a equality function that induces
|
Chris@16
|
1670 //! the same equality as key_equal. The difference is that
|
Chris@16
|
1671 //! "key_value_equal" compares an arbitrary key with the contained values.
|
Chris@16
|
1672 //!
|
Chris@16
|
1673 //! <b>Effects</b>: Finds an iterator to the first element whose key is
|
Chris@16
|
1674 //! "key" according to the given hasher and equality functor or end() if
|
Chris@16
|
1675 //! that element does not exist.
|
Chris@16
|
1676 //!
|
Chris@16
|
1677 //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
|
Chris@16
|
1678 //!
|
Chris@16
|
1679 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1680 //!
|
Chris@16
|
1681 //! <b>Note</b>: This function is used when constructing a value_type
|
Chris@16
|
1682 //! is expensive and the value_type can be compared with a cheaper
|
Chris@16
|
1683 //! key type. Usually this key is part of the value_type.
|
Chris@16
|
1684 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
1685 const_iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
|
Chris@16
|
1686 { return table_type::find(key, hash_func, equal_func); }
|
Chris@16
|
1687
|
Chris@16
|
1688 //! <b>Effects</b>: Returns a range containing all elements with values equivalent
|
Chris@16
|
1689 //! to value. Returns std::make_pair(this->end(), this->end()) if no such
|
Chris@16
|
1690 //! elements exist.
|
Chris@16
|
1691 //!
|
Chris@16
|
1692 //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
|
Chris@16
|
1693 //!
|
Chris@16
|
1694 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1695 std::pair<iterator,iterator> equal_range(const_reference value)
|
Chris@16
|
1696 { return table_type::equal_range(value); }
|
Chris@16
|
1697
|
Chris@16
|
1698 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
1699 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
1700 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
1701 //!
|
Chris@16
|
1702 //! "key_value_equal" must be a equality function that induces
|
Chris@16
|
1703 //! the same equality as key_equal. The difference is that
|
Chris@16
|
1704 //! "key_value_equal" compares an arbitrary key with the contained values.
|
Chris@16
|
1705 //!
|
Chris@16
|
1706 //! <b>Effects</b>: Returns a range containing all elements with equivalent
|
Chris@16
|
1707 //! keys. Returns std::make_pair(this->end(), this->end()) if no such
|
Chris@16
|
1708 //! elements exist.
|
Chris@16
|
1709 //!
|
Chris@16
|
1710 //! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
|
Chris@16
|
1711 //! Worst case O(this->size()).
|
Chris@16
|
1712 //!
|
Chris@16
|
1713 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1714 //!
|
Chris@16
|
1715 //! <b>Note</b>: This function is used when constructing a value_type
|
Chris@16
|
1716 //! is expensive and the value_type can be compared with a cheaper
|
Chris@16
|
1717 //! key type. Usually this key is part of the value_type.
|
Chris@16
|
1718 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
1719 std::pair<iterator,iterator> equal_range
|
Chris@16
|
1720 (const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
|
Chris@16
|
1721 { return table_type::equal_range(key, hash_func, equal_func); }
|
Chris@16
|
1722
|
Chris@16
|
1723 //! <b>Effects</b>: Returns a range containing all elements with values equivalent
|
Chris@16
|
1724 //! to value. Returns std::make_pair(this->end(), this->end()) if no such
|
Chris@16
|
1725 //! elements exist.
|
Chris@16
|
1726 //!
|
Chris@16
|
1727 //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
|
Chris@16
|
1728 //!
|
Chris@16
|
1729 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1730 std::pair<const_iterator, const_iterator>
|
Chris@16
|
1731 equal_range(const_reference value) const
|
Chris@16
|
1732 { return table_type::equal_range(value); }
|
Chris@16
|
1733
|
Chris@16
|
1734 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
1735 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
1736 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
1737 //!
|
Chris@16
|
1738 //! "key_value_equal" must be a equality function that induces
|
Chris@16
|
1739 //! the same equality as key_equal. The difference is that
|
Chris@16
|
1740 //! "key_value_equal" compares an arbitrary key with the contained values.
|
Chris@16
|
1741 //!
|
Chris@16
|
1742 //! <b>Effects</b>: Returns a range containing all elements with equivalent
|
Chris@16
|
1743 //! keys. Returns std::make_pair(this->end(), this->end()) if no such
|
Chris@16
|
1744 //! elements exist.
|
Chris@16
|
1745 //!
|
Chris@16
|
1746 //! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
|
Chris@16
|
1747 //! Worst case O(this->size()).
|
Chris@16
|
1748 //!
|
Chris@16
|
1749 //! <b>Throws</b>: If the internal hasher or the equality functor throws.
|
Chris@16
|
1750 //!
|
Chris@16
|
1751 //! <b>Note</b>: This function is used when constructing a value_type
|
Chris@16
|
1752 //! is expensive and the value_type can be compared with a cheaper
|
Chris@16
|
1753 //! key type. Usually this key is part of the value_type.
|
Chris@16
|
1754 template<class KeyType, class KeyHasher, class KeyValueEqual>
|
Chris@16
|
1755 std::pair<const_iterator, const_iterator>
|
Chris@16
|
1756 equal_range(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
|
Chris@16
|
1757 { return table_type::equal_range(key, hash_func, equal_func); }
|
Chris@16
|
1758
|
Chris@16
|
1759 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_multiset of
|
Chris@16
|
1760 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
1761 //!
|
Chris@16
|
1762 //! <b>Effects</b>: Returns: a valid iterator belonging to the unordered_multiset
|
Chris@16
|
1763 //! that points to the value
|
Chris@16
|
1764 //!
|
Chris@16
|
1765 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1766 //!
|
Chris@16
|
1767 //! <b>Throws</b>: If the hash function throws.
|
Chris@16
|
1768 iterator iterator_to(reference value)
|
Chris@16
|
1769 { return table_type::iterator_to(value); }
|
Chris@16
|
1770
|
Chris@16
|
1771 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_multiset of
|
Chris@16
|
1772 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
1773 //!
|
Chris@16
|
1774 //! <b>Effects</b>: Returns: a valid const_iterator belonging to the
|
Chris@16
|
1775 //! unordered_multiset that points to the value
|
Chris@16
|
1776 //!
|
Chris@16
|
1777 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1778 //!
|
Chris@16
|
1779 //! <b>Throws</b>: If the hash function throws.
|
Chris@16
|
1780 const_iterator iterator_to(const_reference value) const
|
Chris@16
|
1781 { return table_type::iterator_to(value); }
|
Chris@16
|
1782
|
Chris@16
|
1783 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
1784 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
1785 //!
|
Chris@16
|
1786 //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
|
Chris@16
|
1787 //! that points to the value
|
Chris@16
|
1788 //!
|
Chris@16
|
1789 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1790 //!
|
Chris@16
|
1791 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1792 //!
|
Chris@16
|
1793 //! <b>Note</b>: This static function is available only if the <i>value traits</i>
|
Chris@16
|
1794 //! is stateless.
|
Chris@16
|
1795 static local_iterator s_local_iterator_to(reference value)
|
Chris@16
|
1796 { return table_type::s_local_iterator_to(value); }
|
Chris@16
|
1797
|
Chris@16
|
1798 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
1799 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
1800 //!
|
Chris@16
|
1801 //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
|
Chris@16
|
1802 //! the unordered_set that points to the value
|
Chris@16
|
1803 //!
|
Chris@16
|
1804 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1805 //!
|
Chris@16
|
1806 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1807 //!
|
Chris@16
|
1808 //! <b>Note</b>: This static function is available only if the <i>value traits</i>
|
Chris@16
|
1809 //! is stateless.
|
Chris@16
|
1810 static const_local_iterator s_local_iterator_to(const_reference value)
|
Chris@16
|
1811 { return table_type::s_local_iterator_to(value); }
|
Chris@16
|
1812
|
Chris@16
|
1813 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
1814 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
1815 //!
|
Chris@16
|
1816 //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
|
Chris@16
|
1817 //! that points to the value
|
Chris@16
|
1818 //!
|
Chris@16
|
1819 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1820 //!
|
Chris@16
|
1821 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1822 local_iterator local_iterator_to(reference value)
|
Chris@16
|
1823 { return table_type::local_iterator_to(value); }
|
Chris@16
|
1824
|
Chris@16
|
1825 //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
|
Chris@16
|
1826 //! appropriate type. Otherwise the behavior is undefined.
|
Chris@16
|
1827 //!
|
Chris@16
|
1828 //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
|
Chris@16
|
1829 //! the unordered_set that points to the value
|
Chris@16
|
1830 //!
|
Chris@16
|
1831 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1832 //!
|
Chris@16
|
1833 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1834 const_local_iterator local_iterator_to(const_reference value) const
|
Chris@16
|
1835 { return table_type::local_iterator_to(value); }
|
Chris@16
|
1836
|
Chris@16
|
1837 //! <b>Effects</b>: Returns the number of buckets passed in the constructor
|
Chris@16
|
1838 //! or the last rehash function.
|
Chris@16
|
1839 //!
|
Chris@16
|
1840 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1841 //!
|
Chris@16
|
1842 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1843 size_type bucket_count() const
|
Chris@16
|
1844 { return table_type::bucket_count(); }
|
Chris@16
|
1845
|
Chris@16
|
1846 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
1847 //!
|
Chris@16
|
1848 //! <b>Effects</b>: Returns the number of elements in the nth bucket.
|
Chris@16
|
1849 //!
|
Chris@16
|
1850 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1851 //!
|
Chris@16
|
1852 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1853 size_type bucket_size(size_type n) const
|
Chris@16
|
1854 { return table_type::bucket_size(n); }
|
Chris@16
|
1855
|
Chris@16
|
1856 //! <b>Effects</b>: Returns the index of the bucket in which elements
|
Chris@16
|
1857 //! with keys equivalent to k would be found, if any such element existed.
|
Chris@16
|
1858 //!
|
Chris@16
|
1859 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1860 //!
|
Chris@16
|
1861 //! <b>Throws</b>: If the hash functor throws.
|
Chris@16
|
1862 //!
|
Chris@16
|
1863 //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
|
Chris@16
|
1864 size_type bucket(const value_type& k) const
|
Chris@16
|
1865 { return table_type::bucket(k); }
|
Chris@16
|
1866
|
Chris@16
|
1867 //! <b>Requires</b>: "hash_func" must be a hash function that induces
|
Chris@16
|
1868 //! the same hash values as the stored hasher. The difference is that
|
Chris@16
|
1869 //! "hash_func" hashes the given key instead of the value_type.
|
Chris@16
|
1870 //!
|
Chris@16
|
1871 //! <b>Effects</b>: Returns the index of the bucket in which elements
|
Chris@16
|
1872 //! with keys equivalent to k would be found, if any such element existed.
|
Chris@16
|
1873 //!
|
Chris@16
|
1874 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1875 //!
|
Chris@16
|
1876 //! <b>Throws</b>: If the hash functor throws.
|
Chris@16
|
1877 //!
|
Chris@16
|
1878 //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
|
Chris@16
|
1879 template<class KeyType, class KeyHasher>
|
Chris@16
|
1880 size_type bucket(const KeyType& k, const KeyHasher &hash_func) const
|
Chris@16
|
1881 { return table_type::bucket(k, hash_func); }
|
Chris@16
|
1882
|
Chris@16
|
1883 //! <b>Effects</b>: Returns the bucket array pointer passed in the constructor
|
Chris@16
|
1884 //! or the last rehash function.
|
Chris@16
|
1885 //!
|
Chris@16
|
1886 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1887 //!
|
Chris@16
|
1888 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1889 bucket_ptr bucket_pointer() const
|
Chris@16
|
1890 { return table_type::bucket_pointer(); }
|
Chris@16
|
1891
|
Chris@16
|
1892 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
1893 //!
|
Chris@16
|
1894 //! <b>Effects</b>: Returns a local_iterator pointing to the beginning
|
Chris@16
|
1895 //! of the sequence stored in the bucket n.
|
Chris@16
|
1896 //!
|
Chris@16
|
1897 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1898 //!
|
Chris@16
|
1899 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1900 //!
|
Chris@16
|
1901 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
1902 //! containing all of the elements in the nth bucket.
|
Chris@16
|
1903 local_iterator begin(size_type n)
|
Chris@16
|
1904 { return table_type::begin(n); }
|
Chris@16
|
1905
|
Chris@16
|
1906 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
1907 //!
|
Chris@16
|
1908 //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
|
Chris@16
|
1909 //! of the sequence stored in the bucket n.
|
Chris@16
|
1910 //!
|
Chris@16
|
1911 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1912 //!
|
Chris@16
|
1913 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1914 //!
|
Chris@16
|
1915 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
1916 //! containing all of the elements in the nth bucket.
|
Chris@16
|
1917 const_local_iterator begin(size_type n) const
|
Chris@16
|
1918 { return table_type::begin(n); }
|
Chris@16
|
1919
|
Chris@16
|
1920 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
1921 //!
|
Chris@16
|
1922 //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
|
Chris@16
|
1923 //! of the sequence stored in the bucket n.
|
Chris@16
|
1924 //!
|
Chris@16
|
1925 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1926 //!
|
Chris@16
|
1927 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1928 //!
|
Chris@16
|
1929 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
1930 //! containing all of the elements in the nth bucket.
|
Chris@16
|
1931 const_local_iterator cbegin(size_type n) const
|
Chris@16
|
1932 { return table_type::cbegin(n); }
|
Chris@16
|
1933
|
Chris@16
|
1934 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
1935 //!
|
Chris@16
|
1936 //! <b>Effects</b>: Returns a local_iterator pointing to the end
|
Chris@16
|
1937 //! of the sequence stored in the bucket n.
|
Chris@16
|
1938 //!
|
Chris@16
|
1939 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1940 //!
|
Chris@16
|
1941 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1942 //!
|
Chris@16
|
1943 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
1944 //! containing all of the elements in the nth bucket.
|
Chris@16
|
1945 local_iterator end(size_type n)
|
Chris@16
|
1946 { return table_type::end(n); }
|
Chris@16
|
1947
|
Chris@16
|
1948 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
1949 //!
|
Chris@16
|
1950 //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
|
Chris@16
|
1951 //! of the sequence stored in the bucket n.
|
Chris@16
|
1952 //!
|
Chris@16
|
1953 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1954 //!
|
Chris@16
|
1955 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1956 //!
|
Chris@16
|
1957 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
1958 //! containing all of the elements in the nth bucket.
|
Chris@16
|
1959 const_local_iterator end(size_type n) const
|
Chris@16
|
1960 { return table_type::end(n); }
|
Chris@16
|
1961
|
Chris@16
|
1962 //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
|
Chris@16
|
1963 //!
|
Chris@16
|
1964 //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
|
Chris@16
|
1965 //! of the sequence stored in the bucket n.
|
Chris@16
|
1966 //!
|
Chris@16
|
1967 //! <b>Complexity</b>: Constant.
|
Chris@16
|
1968 //!
|
Chris@16
|
1969 //! <b>Throws</b>: Nothing.
|
Chris@16
|
1970 //!
|
Chris@16
|
1971 //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
|
Chris@16
|
1972 //! containing all of the elements in the nth bucket.
|
Chris@16
|
1973 const_local_iterator cend(size_type n) const
|
Chris@16
|
1974 { return table_type::cend(n); }
|
Chris@16
|
1975
|
Chris@16
|
1976 //! <b>Requires</b>: new_buckets must be a pointer to a new bucket array
|
Chris@16
|
1977 //! or the same as the old bucket array. new_size is the length of the
|
Chris@16
|
1978 //! the array pointed by new_buckets. If new_buckets == this->bucket_pointer()
|
Chris@16
|
1979 //! n can be bigger or smaller than this->bucket_count().
|
Chris@16
|
1980 //!
|
Chris@16
|
1981 //! <b>Effects</b>: Updates the internal reference with the new bucket erases
|
Chris@16
|
1982 //! the values from the old bucket and inserts then in the new one.
|
Chris@16
|
1983 //!
|
Chris@16
|
1984 //! If store_hash option is true, this method does not use the hash function.
|
Chris@16
|
1985 //!
|
Chris@16
|
1986 //! <b>Complexity</b>: Average case linear in this->size(), worst case quadratic.
|
Chris@16
|
1987 //!
|
Chris@16
|
1988 //! <b>Throws</b>: If the hasher functor throws.
|
Chris@16
|
1989 void rehash(const bucket_traits &new_bucket_traits)
|
Chris@16
|
1990 { table_type::rehash(new_bucket_traits); }
|
Chris@16
|
1991
|
Chris@16
|
1992 //! <b>Requires</b>:
|
Chris@16
|
1993 //!
|
Chris@16
|
1994 //! <b>Effects</b>:
|
Chris@16
|
1995 //!
|
Chris@16
|
1996 //! <b>Complexity</b>:
|
Chris@16
|
1997 //!
|
Chris@16
|
1998 //! <b>Throws</b>:
|
Chris@16
|
1999 //!
|
Chris@16
|
2000 //! <b>Note</b>: this method is only available if incremental<true> option is activated.
|
Chris@16
|
2001 bool incremental_rehash(bool grow = true)
|
Chris@16
|
2002 { return table_type::incremental_rehash(grow); }
|
Chris@16
|
2003
|
Chris@16
|
2004 //! <b>Note</b>: this method is only available if incremental<true> option is activated.
|
Chris@16
|
2005 bool incremental_rehash(const bucket_traits &new_bucket_traits)
|
Chris@16
|
2006 { return table_type::incremental_rehash(new_bucket_traits); }
|
Chris@16
|
2007
|
Chris@16
|
2008 //! <b>Requires</b>:
|
Chris@16
|
2009 //!
|
Chris@16
|
2010 //! <b>Effects</b>:
|
Chris@16
|
2011 //!
|
Chris@16
|
2012 //! <b>Complexity</b>:
|
Chris@16
|
2013 //!
|
Chris@16
|
2014 //! <b>Throws</b>:
|
Chris@16
|
2015 size_type split_count() const
|
Chris@16
|
2016 { return table_type::split_count(); }
|
Chris@16
|
2017
|
Chris@16
|
2018 //! <b>Effects</b>: Returns the nearest new bucket count optimized for
|
Chris@16
|
2019 //! the container that is bigger than n. This suggestion can be used
|
Chris@16
|
2020 //! to create bucket arrays with a size that will usually improve
|
Chris@16
|
2021 //! container's performance. If such value does not exist, the
|
Chris@16
|
2022 //! higher possible value is returned.
|
Chris@16
|
2023 //!
|
Chris@16
|
2024 //! <b>Complexity</b>: Amortized constant time.
|
Chris@16
|
2025 //!
|
Chris@16
|
2026 //! <b>Throws</b>: Nothing.
|
Chris@16
|
2027 static size_type suggested_upper_bucket_count(size_type n)
|
Chris@16
|
2028 { return table_type::suggested_upper_bucket_count(n); }
|
Chris@16
|
2029
|
Chris@16
|
2030 //! <b>Effects</b>: Returns the nearest new bucket count optimized for
|
Chris@16
|
2031 //! the container that is smaller than n. This suggestion can be used
|
Chris@16
|
2032 //! to create bucket arrays with a size that will usually improve
|
Chris@16
|
2033 //! container's performance. If such value does not exist, the
|
Chris@16
|
2034 //! lower possible value is returned.
|
Chris@16
|
2035 //!
|
Chris@16
|
2036 //! <b>Complexity</b>: Amortized constant time.
|
Chris@16
|
2037 //!
|
Chris@16
|
2038 //! <b>Throws</b>: Nothing.
|
Chris@16
|
2039 static size_type suggested_lower_bucket_count(size_type n)
|
Chris@16
|
2040 { return table_type::suggested_lower_bucket_count(n); }
|
Chris@16
|
2041
|
Chris@16
|
2042 #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
2043 };
|
Chris@16
|
2044
|
Chris@16
|
2045 //! Helper metafunction to define an \c unordered_multiset that yields to the same type when the
|
Chris@16
|
2046 //! same options (either explicitly or implicitly) are used.
|
Chris@16
|
2047 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
2048 template<class T, class ...Options>
|
Chris@16
|
2049 #else
|
Chris@16
|
2050 template<class T, class O1 = void, class O2 = void
|
Chris@16
|
2051 , class O3 = void, class O4 = void
|
Chris@16
|
2052 , class O5 = void, class O6 = void
|
Chris@16
|
2053 , class O7 = void, class O8 = void
|
Chris@16
|
2054 , class O9 = void, class O10= void
|
Chris@16
|
2055 >
|
Chris@16
|
2056 #endif
|
Chris@16
|
2057 struct make_unordered_multiset
|
Chris@16
|
2058 {
|
Chris@16
|
2059 /// @cond
|
Chris@16
|
2060 typedef typename pack_options
|
Chris@16
|
2061 < hashtable_defaults,
|
Chris@16
|
2062 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
2063 O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
|
Chris@16
|
2064 #else
|
Chris@16
|
2065 Options...
|
Chris@16
|
2066 #endif
|
Chris@16
|
2067 >::type packed_options;
|
Chris@16
|
2068
|
Chris@16
|
2069 typedef typename detail::get_value_traits
|
Chris@16
|
2070 <T, typename packed_options::proto_value_traits>::type value_traits;
|
Chris@16
|
2071
|
Chris@101
|
2072 typedef typename make_bucket_traits
|
Chris@101
|
2073 <T, true, packed_options>::type bucket_traits;
|
Chris@16
|
2074
|
Chris@16
|
2075 typedef unordered_multiset_impl
|
Chris@16
|
2076 < value_traits
|
Chris@16
|
2077 , typename packed_options::hash
|
Chris@16
|
2078 , typename packed_options::equal
|
Chris@16
|
2079 , typename packed_options::size_type
|
Chris@101
|
2080 , bucket_traits
|
Chris@16
|
2081 , (std::size_t(false)*hash_bool_flags::unique_keys_pos)
|
Chris@16
|
2082 | (std::size_t(packed_options::constant_time_size)*hash_bool_flags::constant_time_size_pos)
|
Chris@16
|
2083 | (std::size_t(packed_options::power_2_buckets)*hash_bool_flags::power_2_buckets_pos)
|
Chris@16
|
2084 | (std::size_t(packed_options::cache_begin)*hash_bool_flags::cache_begin_pos)
|
Chris@16
|
2085 | (std::size_t(packed_options::compare_hash)*hash_bool_flags::compare_hash_pos)
|
Chris@16
|
2086 | (std::size_t(packed_options::incremental)*hash_bool_flags::incremental_pos)
|
Chris@16
|
2087 > implementation_defined;
|
Chris@16
|
2088
|
Chris@16
|
2089 /// @endcond
|
Chris@16
|
2090 typedef implementation_defined type;
|
Chris@16
|
2091 };
|
Chris@16
|
2092
|
Chris@16
|
2093 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
2094
|
Chris@16
|
2095 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
2096 template<class T, class O1, class O2, class O3, class O4, class O5, class O6, class O7, class O8, class O9, class O10>
|
Chris@16
|
2097 #else
|
Chris@16
|
2098 template<class T, class ...Options>
|
Chris@16
|
2099 #endif
|
Chris@16
|
2100 class unordered_multiset
|
Chris@16
|
2101 : public make_unordered_multiset<T,
|
Chris@16
|
2102 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
2103 O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
|
Chris@16
|
2104 #else
|
Chris@16
|
2105 Options...
|
Chris@16
|
2106 #endif
|
Chris@16
|
2107 >::type
|
Chris@16
|
2108 {
|
Chris@16
|
2109 typedef typename make_unordered_multiset
|
Chris@16
|
2110 <T,
|
Chris@16
|
2111 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
2112 O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
|
Chris@16
|
2113 #else
|
Chris@16
|
2114 Options...
|
Chris@16
|
2115 #endif
|
Chris@16
|
2116 >::type Base;
|
Chris@16
|
2117 //Assert if passed value traits are compatible with the type
|
Chris@16
|
2118 BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
|
Chris@16
|
2119 BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_multiset)
|
Chris@16
|
2120
|
Chris@16
|
2121 public:
|
Chris@16
|
2122 typedef typename Base::value_traits value_traits;
|
Chris@16
|
2123 typedef typename Base::bucket_traits bucket_traits;
|
Chris@16
|
2124 typedef typename Base::iterator iterator;
|
Chris@16
|
2125 typedef typename Base::const_iterator const_iterator;
|
Chris@16
|
2126 typedef typename Base::bucket_ptr bucket_ptr;
|
Chris@16
|
2127 typedef typename Base::size_type size_type;
|
Chris@16
|
2128 typedef typename Base::hasher hasher;
|
Chris@16
|
2129 typedef typename Base::key_equal key_equal;
|
Chris@16
|
2130
|
Chris@16
|
2131 explicit unordered_multiset( const bucket_traits &b_traits
|
Chris@16
|
2132 , const hasher & hash_func = hasher()
|
Chris@16
|
2133 , const key_equal &equal_func = key_equal()
|
Chris@16
|
2134 , const value_traits &v_traits = value_traits())
|
Chris@16
|
2135 : Base(b_traits, hash_func, equal_func, v_traits)
|
Chris@16
|
2136 {}
|
Chris@16
|
2137
|
Chris@16
|
2138 template<class Iterator>
|
Chris@16
|
2139 unordered_multiset( Iterator b
|
Chris@16
|
2140 , Iterator e
|
Chris@16
|
2141 , const bucket_traits &b_traits
|
Chris@16
|
2142 , const hasher & hash_func = hasher()
|
Chris@16
|
2143 , const key_equal &equal_func = key_equal()
|
Chris@16
|
2144 , const value_traits &v_traits = value_traits())
|
Chris@16
|
2145 : Base(b, e, b_traits, hash_func, equal_func, v_traits)
|
Chris@16
|
2146 {}
|
Chris@16
|
2147
|
Chris@16
|
2148 unordered_multiset(BOOST_RV_REF(unordered_multiset) x)
|
Chris@101
|
2149 : Base(BOOST_MOVE_BASE(Base, x))
|
Chris@16
|
2150 {}
|
Chris@16
|
2151
|
Chris@16
|
2152 unordered_multiset& operator=(BOOST_RV_REF(unordered_multiset) x)
|
Chris@101
|
2153 { return static_cast<unordered_multiset&>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
Chris@16
|
2154 };
|
Chris@16
|
2155
|
Chris@16
|
2156 #endif
|
Chris@16
|
2157
|
Chris@16
|
2158 } //namespace intrusive
|
Chris@16
|
2159 } //namespace boost
|
Chris@16
|
2160
|
Chris@16
|
2161 #include <boost/intrusive/detail/config_end.hpp>
|
Chris@16
|
2162
|
Chris@16
|
2163 #endif //BOOST_INTRUSIVE_UNORDERED_SET_HPP
|