Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/intrusive/treap_set.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children | c530137014c0 |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 ///////////////////////////////////////////////////////////////////////////// | |
2 // | |
3 // (C) Copyright Ion Gaztanaga 2007-2013 | |
4 // | |
5 // Distributed under the Boost Software License, Version 1.0. | |
6 // (See accompanying file LICENSE_1_0.txt or copy at | |
7 // http://www.boost.org/LICENSE_1_0.txt) | |
8 // | |
9 // See http://www.boost.org/libs/intrusive for documentation. | |
10 // | |
11 ///////////////////////////////////////////////////////////////////////////// | |
12 #ifndef BOOST_INTRUSIVE_TRIE_SET_HPP | |
13 #define BOOST_INTRUSIVE_TRIE_SET_HPP | |
14 | |
15 #include <boost/intrusive/detail/config_begin.hpp> | |
16 #include <boost/intrusive/intrusive_fwd.hpp> | |
17 #include <boost/intrusive/treap.hpp> | |
18 #include <boost/intrusive/detail/mpl.hpp> | |
19 #include <boost/move/move.hpp> | |
20 #include <iterator> | |
21 | |
22 namespace boost { | |
23 namespace intrusive { | |
24 | |
25 //! The class template treap_set is an intrusive container, that mimics most of | |
26 //! the interface of std::set as described in the C++ standard. | |
27 //! | |
28 //! The template parameter \c T is the type to be managed by the container. | |
29 //! The user can specify additional options and if no options are provided | |
30 //! default options are used. | |
31 //! | |
32 //! The container supports the following options: | |
33 //! \c base_hook<>/member_hook<>/value_traits<>, | |
34 //! \c constant_time_size<>, \c size_type<>, | |
35 //! \c compare<> and \c priority_compare<> | |
36 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) | |
37 template<class T, class ...Options> | |
38 #else | |
39 template<class ValueTraits, class VoidOrKeyComp, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize> | |
40 #endif | |
41 class treap_set_impl | |
42 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
43 : public treap_impl<ValueTraits, VoidOrKeyComp, VoidOrPrioComp, SizeType, ConstantTimeSize> | |
44 #endif | |
45 { | |
46 /// @cond | |
47 typedef treap_impl<ValueTraits, VoidOrKeyComp, VoidOrPrioComp, SizeType, ConstantTimeSize> tree_type; | |
48 BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_set_impl) | |
49 | |
50 typedef tree_type implementation_defined; | |
51 /// @endcond | |
52 | |
53 public: | |
54 typedef typename implementation_defined::value_type value_type; | |
55 typedef typename implementation_defined::value_traits value_traits; | |
56 typedef typename implementation_defined::pointer pointer; | |
57 typedef typename implementation_defined::const_pointer const_pointer; | |
58 typedef typename implementation_defined::reference reference; | |
59 typedef typename implementation_defined::const_reference const_reference; | |
60 typedef typename implementation_defined::difference_type difference_type; | |
61 typedef typename implementation_defined::size_type size_type; | |
62 typedef typename implementation_defined::value_compare value_compare; | |
63 typedef typename implementation_defined::priority_compare priority_compare; | |
64 typedef typename implementation_defined::key_compare key_compare; | |
65 typedef typename implementation_defined::iterator iterator; | |
66 typedef typename implementation_defined::const_iterator const_iterator; | |
67 typedef typename implementation_defined::reverse_iterator reverse_iterator; | |
68 typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator; | |
69 typedef typename implementation_defined::insert_commit_data insert_commit_data; | |
70 typedef typename implementation_defined::node_traits node_traits; | |
71 typedef typename implementation_defined::node node; | |
72 typedef typename implementation_defined::node_ptr node_ptr; | |
73 typedef typename implementation_defined::const_node_ptr const_node_ptr; | |
74 typedef typename implementation_defined::node_algorithms node_algorithms; | |
75 | |
76 static const bool constant_time_size = implementation_defined::constant_time_size; | |
77 | |
78 public: | |
79 //! <b>Effects</b>: Constructs an empty treap_set. | |
80 //! | |
81 //! <b>Complexity</b>: Constant. | |
82 //! | |
83 //! <b>Throws</b>: If value_traits::node_traits::node | |
84 //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) | |
85 //! or the copy constructor of the value_compare object throws. | |
86 explicit treap_set_impl( const value_compare &cmp = value_compare() | |
87 , const priority_compare &pcmp = priority_compare() | |
88 , const value_traits &v_traits = value_traits()) | |
89 : tree_type(cmp, pcmp, v_traits) | |
90 {} | |
91 | |
92 //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type. | |
93 //! cmp must be a comparison function that induces a strict weak ordering. | |
94 //! | |
95 //! <b>Effects</b>: Constructs an empty treap_set and inserts elements from | |
96 //! [b, e). | |
97 //! | |
98 //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using | |
99 //! comp and otherwise N * log N, where N is std::distance(last, first). | |
100 //! | |
101 //! <b>Throws</b>: If value_traits::node_traits::node | |
102 //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) | |
103 //! or the copy constructor/operator() of the value_compare object throws. | |
104 template<class Iterator> | |
105 treap_set_impl( Iterator b, Iterator e | |
106 , const value_compare &cmp = value_compare() | |
107 , const priority_compare &pcmp = priority_compare() | |
108 , const value_traits &v_traits = value_traits()) | |
109 : tree_type(true, b, e, cmp, pcmp, v_traits) | |
110 {} | |
111 | |
112 //! <b>Effects</b>: to-do | |
113 //! | |
114 treap_set_impl(BOOST_RV_REF(treap_set_impl) x) | |
115 : tree_type(::boost::move(static_cast<tree_type&>(x))) | |
116 {} | |
117 | |
118 //! <b>Effects</b>: to-do | |
119 //! | |
120 treap_set_impl& operator=(BOOST_RV_REF(treap_set_impl) x) | |
121 { return static_cast<treap_set_impl&>(tree_type::operator=(::boost::move(static_cast<tree_type&>(x)))); } | |
122 | |
123 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
124 //! @copydoc ::boost::intrusive::treap::~treap() | |
125 ~treap_set_impl(); | |
126 | |
127 //! @copydoc ::boost::intrusive::treap::begin() | |
128 iterator begin(); | |
129 | |
130 //! @copydoc ::boost::intrusive::treap::begin()const | |
131 const_iterator begin() const; | |
132 | |
133 //! @copydoc ::boost::intrusive::treap::cbegin()const | |
134 const_iterator cbegin() const; | |
135 | |
136 //! @copydoc ::boost::intrusive::treap::end() | |
137 iterator end(); | |
138 | |
139 //! @copydoc ::boost::intrusive::treap::end()const | |
140 const_iterator end() const; | |
141 | |
142 //! @copydoc ::boost::intrusive::treap::cend()const | |
143 const_iterator cend() const; | |
144 | |
145 //! @copydoc ::boost::intrusive::treap::rbegin() | |
146 reverse_iterator rbegin(); | |
147 | |
148 //! @copydoc ::boost::intrusive::treap::rbegin()const | |
149 const_reverse_iterator rbegin() const; | |
150 | |
151 //! @copydoc ::boost::intrusive::treap::crbegin()const | |
152 const_reverse_iterator crbegin() const; | |
153 | |
154 //! @copydoc ::boost::intrusive::treap::rend() | |
155 reverse_iterator rend(); | |
156 | |
157 //! @copydoc ::boost::intrusive::treap::rend()const | |
158 const_reverse_iterator rend() const; | |
159 | |
160 //! @copydoc ::boost::intrusive::treap::crend()const | |
161 const_reverse_iterator crend() const; | |
162 | |
163 //! @copydoc ::boost::intrusive::treap::container_from_end_iterator(iterator) | |
164 static treap_set_impl &container_from_end_iterator(iterator end_iterator); | |
165 | |
166 //! @copydoc ::boost::intrusive::treap::container_from_end_iterator(const_iterator) | |
167 static const treap_set_impl &container_from_end_iterator(const_iterator end_iterator); | |
168 | |
169 //! @copydoc ::boost::intrusive::treap::container_from_iterator(iterator) | |
170 static treap_set_impl &container_from_iterator(iterator it); | |
171 | |
172 //! @copydoc ::boost::intrusive::treap::container_from_iterator(const_iterator) | |
173 static const treap_set_impl &container_from_iterator(const_iterator it); | |
174 | |
175 //! @copydoc ::boost::intrusive::treap::key_comp()const | |
176 key_compare key_comp() const; | |
177 | |
178 //! @copydoc ::boost::intrusive::treap::value_comp()const | |
179 value_compare value_comp() const; | |
180 | |
181 //! @copydoc ::boost::intrusive::treap::empty()const | |
182 bool empty() const; | |
183 | |
184 //! @copydoc ::boost::intrusive::treap::size()const | |
185 size_type size() const; | |
186 | |
187 //! @copydoc ::boost::intrusive::treap::swap | |
188 void swap(treap_set_impl& other); | |
189 | |
190 //! @copydoc ::boost::intrusive::treap::clone_from | |
191 template <class Cloner, class Disposer> | |
192 void clone_from(const treap_set_impl &src, Cloner cloner, Disposer disposer); | |
193 | |
194 //! @copydoc ::boost::intrusive::treap::top() | |
195 iterator top(); | |
196 | |
197 //! @copydoc ::boost::intrusive::treap::top()const | |
198 const_iterator top() const; | |
199 | |
200 //! @copydoc ::boost::intrusive::treap::ctop()const | |
201 const_iterator ctop() const; | |
202 | |
203 //! @copydoc ::boost::intrusive::treap::rtop() | |
204 reverse_iterator rtop(); | |
205 | |
206 //! @copydoc ::boost::intrusive::treap::rtop()const | |
207 const_reverse_iterator rtop() const; | |
208 | |
209 //! @copydoc ::boost::intrusive::treap::crtop()const | |
210 const_reverse_iterator crtop() const; | |
211 | |
212 //! @copydoc ::boost::intrusive::treap::crtop() const | |
213 priority_compare priority_comp() const; | |
214 #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
215 | |
216 //! @copydoc ::boost::intrusive::treap::insert_unique(reference) | |
217 std::pair<iterator, bool> insert(reference value) | |
218 { return tree_type::insert_unique(value); } | |
219 | |
220 //! @copydoc ::boost::intrusive::treap::insert_unique(const_iterator,reference) | |
221 iterator insert(const_iterator hint, reference value) | |
222 { return tree_type::insert_unique(hint, value); } | |
223 | |
224 //! @copydoc ::boost::intrusive::treap::insert_unique_check(const KeyType&,KeyValueCompare,KeyValuePrioCompare,insert_commit_data&) | |
225 template<class KeyType, class KeyValueCompare, class KeyValuePrioCompare> | |
226 std::pair<iterator, bool> insert_check | |
227 ( const KeyType &key, KeyValueCompare key_value_comp, KeyValuePrioCompare key_value_pcomp | |
228 , insert_commit_data &commit_data) | |
229 { return tree_type::insert_unique_check(key, key_value_comp, key_value_pcomp, commit_data); } | |
230 | |
231 //! @copydoc ::boost::intrusive::treap::insert_unique_check(const_iterator,const KeyType&,KeyValueCompare,KeyValuePrioCompare,insert_commit_data&) | |
232 template<class KeyType, class KeyValueCompare, class KeyValuePrioCompare> | |
233 std::pair<iterator, bool> insert_check | |
234 ( const_iterator hint, const KeyType &key | |
235 , KeyValueCompare key_value_comp, KeyValuePrioCompare key_value_pcomp | |
236 , insert_commit_data &commit_data) | |
237 { return tree_type::insert_unique_check(hint, key, key_value_comp, key_value_pcomp, commit_data); } | |
238 | |
239 //! @copydoc ::boost::intrusive::treap::insert_unique(Iterator,Iterator) | |
240 template<class Iterator> | |
241 void insert(Iterator b, Iterator e) | |
242 { tree_type::insert_unique(b, e); } | |
243 | |
244 //! @copydoc ::boost::intrusive::treap::insert_unique_commit | |
245 iterator insert_commit(reference value, const insert_commit_data &commit_data) | |
246 { return tree_type::insert_unique_commit(value, commit_data); } | |
247 | |
248 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
249 //! @copydoc ::boost::intrusive::treap::insert_before | |
250 iterator insert_before(const_iterator pos, reference value); | |
251 | |
252 //! @copydoc ::boost::intrusive::treap::push_back | |
253 void push_back(reference value); | |
254 | |
255 //! @copydoc ::boost::intrusive::treap::push_front | |
256 void push_front(reference value); | |
257 | |
258 //! @copydoc ::boost::intrusive::treap::erase(const_iterator) | |
259 iterator erase(const_iterator i); | |
260 | |
261 //! @copydoc ::boost::intrusive::treap::erase(const_iterator,const_iterator) | |
262 iterator erase(const_iterator b, const_iterator e); | |
263 | |
264 //! @copydoc ::boost::intrusive::treap::erase(const_reference) | |
265 size_type erase(const_reference value); | |
266 | |
267 //! @copydoc ::boost::intrusive::treap::erase(const KeyType&,KeyValueCompare) | |
268 template<class KeyType, class KeyValueCompare> | |
269 size_type erase(const KeyType& key, KeyValueCompare comp); | |
270 | |
271 //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_iterator,Disposer) | |
272 template<class Disposer> | |
273 iterator erase_and_dispose(const_iterator i, Disposer disposer); | |
274 | |
275 //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_iterator,const_iterator,Disposer) | |
276 template<class Disposer> | |
277 iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); | |
278 | |
279 //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_reference, Disposer) | |
280 template<class Disposer> | |
281 size_type erase_and_dispose(const_reference value, Disposer disposer); | |
282 | |
283 //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const KeyType&,KeyValueCompare,Disposer) | |
284 template<class KeyType, class KeyValueCompare, class Disposer> | |
285 size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer); | |
286 | |
287 //! @copydoc ::boost::intrusive::treap::clear | |
288 void clear(); | |
289 | |
290 //! @copydoc ::boost::intrusive::treap::clear_and_dispose | |
291 template<class Disposer> | |
292 void clear_and_dispose(Disposer disposer); | |
293 | |
294 //! @copydoc ::boost::intrusive::treap::count(const_reference)const | |
295 size_type count(const_reference value) const; | |
296 | |
297 //! @copydoc ::boost::intrusive::treap::count(const KeyType&,KeyValueCompare)const | |
298 template<class KeyType, class KeyValueCompare> | |
299 size_type count(const KeyType& key, KeyValueCompare comp) const; | |
300 | |
301 //! @copydoc ::boost::intrusive::treap::lower_bound(const_reference) | |
302 iterator lower_bound(const_reference value); | |
303 | |
304 //! @copydoc ::boost::intrusive::treap::lower_bound(const KeyType&,KeyValueCompare) | |
305 template<class KeyType, class KeyValueCompare> | |
306 iterator lower_bound(const KeyType& key, KeyValueCompare comp); | |
307 | |
308 //! @copydoc ::boost::intrusive::treap::lower_bound(const_reference)const | |
309 const_iterator lower_bound(const_reference value) const; | |
310 | |
311 //! @copydoc ::boost::intrusive::treap::lower_bound(const KeyType&,KeyValueCompare)const | |
312 template<class KeyType, class KeyValueCompare> | |
313 const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const; | |
314 | |
315 //! @copydoc ::boost::intrusive::treap::upper_bound(const_reference) | |
316 iterator upper_bound(const_reference value); | |
317 | |
318 //! @copydoc ::boost::intrusive::treap::upper_bound(const KeyType&,KeyValueCompare) | |
319 template<class KeyType, class KeyValueCompare> | |
320 iterator upper_bound(const KeyType& key, KeyValueCompare comp); | |
321 | |
322 //! @copydoc ::boost::intrusive::treap::upper_bound(const_reference)const | |
323 const_iterator upper_bound(const_reference value) const; | |
324 | |
325 //! @copydoc ::boost::intrusive::treap::upper_bound(const KeyType&,KeyValueCompare)const | |
326 template<class KeyType, class KeyValueCompare> | |
327 const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const; | |
328 | |
329 //! @copydoc ::boost::intrusive::treap::find(const_reference) | |
330 iterator find(const_reference value); | |
331 | |
332 //! @copydoc ::boost::intrusive::treap::find(const KeyType&,KeyValueCompare) | |
333 template<class KeyType, class KeyValueCompare> | |
334 iterator find(const KeyType& key, KeyValueCompare comp); | |
335 | |
336 //! @copydoc ::boost::intrusive::treap::find(const_reference)const | |
337 const_iterator find(const_reference value) const; | |
338 | |
339 //! @copydoc ::boost::intrusive::treap::find(const KeyType&,KeyValueCompare)const | |
340 template<class KeyType, class KeyValueCompare> | |
341 const_iterator find(const KeyType& key, KeyValueCompare comp) const; | |
342 | |
343 //! @copydoc ::boost::intrusive::treap::equal_range(const_reference) | |
344 std::pair<iterator,iterator> equal_range(const_reference value); | |
345 | |
346 //! @copydoc ::boost::intrusive::treap::equal_range(const KeyType&,KeyValueCompare) | |
347 template<class KeyType, class KeyValueCompare> | |
348 std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp); | |
349 | |
350 //! @copydoc ::boost::intrusive::treap::equal_range(const_reference)const | |
351 std::pair<const_iterator, const_iterator> | |
352 equal_range(const_reference value) const; | |
353 | |
354 //! @copydoc ::boost::intrusive::treap::equal_range(const KeyType&,KeyValueCompare)const | |
355 template<class KeyType, class KeyValueCompare> | |
356 std::pair<const_iterator, const_iterator> | |
357 equal_range(const KeyType& key, KeyValueCompare comp) const; | |
358 | |
359 //! @copydoc ::boost::intrusive::treap::bounded_range(const_reference,const_reference,bool,bool) | |
360 std::pair<iterator,iterator> bounded_range | |
361 (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed); | |
362 | |
363 //! @copydoc ::boost::intrusive::treap::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool) | |
364 template<class KeyType, class KeyValueCompare> | |
365 std::pair<iterator,iterator> bounded_range | |
366 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed); | |
367 | |
368 //! @copydoc ::boost::intrusive::treap::bounded_range(const_reference,const_reference,bool,bool)const | |
369 std::pair<const_iterator, const_iterator> | |
370 bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const; | |
371 | |
372 //! @copydoc ::boost::intrusive::treap::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool)const | |
373 template<class KeyType, class KeyValueCompare> | |
374 std::pair<const_iterator, const_iterator> bounded_range | |
375 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const; | |
376 | |
377 //! @copydoc ::boost::intrusive::treap::s_iterator_to(reference) | |
378 static iterator s_iterator_to(reference value); | |
379 | |
380 //! @copydoc ::boost::intrusive::treap::s_iterator_to(const_reference) | |
381 static const_iterator s_iterator_to(const_reference value); | |
382 | |
383 //! @copydoc ::boost::intrusive::treap::iterator_to(reference) | |
384 iterator iterator_to(reference value); | |
385 | |
386 //! @copydoc ::boost::intrusive::treap::iterator_to(const_reference)const | |
387 const_iterator iterator_to(const_reference value) const; | |
388 | |
389 //! @copydoc ::boost::intrusive::treap::init_node(reference) | |
390 static void init_node(reference value); | |
391 | |
392 //! @copydoc ::boost::intrusive::treap::unlink_leftmost_without_rebalance | |
393 pointer unlink_leftmost_without_rebalance(); | |
394 | |
395 //! @copydoc ::boost::intrusive::treap::replace_node | |
396 void replace_node(iterator replace_this, reference with_this); | |
397 | |
398 //! @copydoc ::boost::intrusive::treap::remove_node | |
399 void remove_node(reference value); | |
400 | |
401 #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
402 }; | |
403 | |
404 | |
405 //! Helper metafunction to define a \c treap_set that yields to the same type when the | |
406 //! same options (either explicitly or implicitly) are used. | |
407 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
408 template<class T, class ...Options> | |
409 #else | |
410 template<class T, class O1 = void, class O2 = void | |
411 , class O3 = void, class O4 = void> | |
412 #endif | |
413 struct make_treap_set | |
414 { | |
415 typedef typename pack_options | |
416 < treap_defaults, | |
417 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
418 O1, O2, O3, O4 | |
419 #else | |
420 Options... | |
421 #endif | |
422 >::type packed_options; | |
423 | |
424 typedef typename detail::get_value_traits | |
425 <T, typename packed_options::proto_value_traits>::type value_traits; | |
426 | |
427 typedef treap_set_impl | |
428 < value_traits | |
429 , typename packed_options::compare | |
430 , typename packed_options::priority | |
431 , typename packed_options::size_type | |
432 , packed_options::constant_time_size | |
433 > implementation_defined; | |
434 /// @endcond | |
435 typedef implementation_defined type; | |
436 }; | |
437 | |
438 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
439 | |
440 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
441 template<class T, class O1, class O2, class O3, class O4> | |
442 #else | |
443 template<class T, class ...Options> | |
444 #endif | |
445 class treap_set | |
446 : public make_treap_set<T, | |
447 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
448 O1, O2, O3, O4 | |
449 #else | |
450 Options... | |
451 #endif | |
452 >::type | |
453 { | |
454 typedef typename make_treap_set | |
455 <T, | |
456 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
457 O1, O2, O3, O4 | |
458 #else | |
459 Options... | |
460 #endif | |
461 >::type Base; | |
462 BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_set) | |
463 | |
464 public: | |
465 typedef typename Base::value_compare value_compare; | |
466 typedef typename Base::priority_compare priority_compare; | |
467 typedef typename Base::value_traits value_traits; | |
468 typedef typename Base::iterator iterator; | |
469 typedef typename Base::const_iterator const_iterator; | |
470 | |
471 //Assert if passed value traits are compatible with the type | |
472 BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value)); | |
473 | |
474 explicit treap_set( const value_compare &cmp = value_compare() | |
475 , const priority_compare &pcmp = priority_compare() | |
476 , const value_traits &v_traits = value_traits()) | |
477 : Base(cmp, pcmp, v_traits) | |
478 {} | |
479 | |
480 template<class Iterator> | |
481 treap_set( Iterator b, Iterator e | |
482 , const value_compare &cmp = value_compare() | |
483 , const priority_compare &pcmp = priority_compare() | |
484 , const value_traits &v_traits = value_traits()) | |
485 : Base(b, e, cmp, pcmp, v_traits) | |
486 {} | |
487 | |
488 treap_set(BOOST_RV_REF(treap_set) x) | |
489 : Base(::boost::move(static_cast<Base&>(x))) | |
490 {} | |
491 | |
492 treap_set& operator=(BOOST_RV_REF(treap_set) x) | |
493 { return static_cast<treap_set &>(this->Base::operator=(::boost::move(static_cast<Base&>(x)))); } | |
494 | |
495 static treap_set &container_from_end_iterator(iterator end_iterator) | |
496 { return static_cast<treap_set &>(Base::container_from_end_iterator(end_iterator)); } | |
497 | |
498 static const treap_set &container_from_end_iterator(const_iterator end_iterator) | |
499 { return static_cast<const treap_set &>(Base::container_from_end_iterator(end_iterator)); } | |
500 | |
501 static treap_set &container_from_iterator(iterator it) | |
502 { return static_cast<treap_set &>(Base::container_from_iterator(it)); } | |
503 | |
504 static const treap_set &container_from_iterator(const_iterator it) | |
505 { return static_cast<const treap_set &>(Base::container_from_iterator(it)); } | |
506 }; | |
507 | |
508 #endif | |
509 | |
510 //! The class template treap_multiset is an intrusive container, that mimics most of | |
511 //! the interface of std::treap_multiset as described in the C++ standard. | |
512 //! | |
513 //! The template parameter \c T is the type to be managed by the container. | |
514 //! The user can specify additional options and if no options are provided | |
515 //! default options are used. | |
516 //! | |
517 //! The container supports the following options: | |
518 //! \c base_hook<>/member_hook<>/value_traits<>, | |
519 //! \c constant_time_size<>, \c size_type<>, | |
520 //! \c compare<> and \c priority_compare<> | |
521 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) | |
522 template<class T, class ...Options> | |
523 #else | |
524 template<class ValueTraits, class VoidOrKeyComp, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize> | |
525 #endif | |
526 class treap_multiset_impl | |
527 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
528 : public treap_impl<ValueTraits, VoidOrKeyComp, VoidOrPrioComp, SizeType, ConstantTimeSize> | |
529 #endif | |
530 { | |
531 /// @cond | |
532 typedef treap_impl<ValueTraits, VoidOrKeyComp, VoidOrPrioComp, SizeType, ConstantTimeSize> tree_type; | |
533 BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_multiset_impl) | |
534 | |
535 typedef tree_type implementation_defined; | |
536 /// @endcond | |
537 | |
538 public: | |
539 typedef typename implementation_defined::value_type value_type; | |
540 typedef typename implementation_defined::value_traits value_traits; | |
541 typedef typename implementation_defined::pointer pointer; | |
542 typedef typename implementation_defined::const_pointer const_pointer; | |
543 typedef typename implementation_defined::reference reference; | |
544 typedef typename implementation_defined::const_reference const_reference; | |
545 typedef typename implementation_defined::difference_type difference_type; | |
546 typedef typename implementation_defined::size_type size_type; | |
547 typedef typename implementation_defined::value_compare value_compare; | |
548 typedef typename implementation_defined::priority_compare priority_compare; | |
549 typedef typename implementation_defined::key_compare key_compare; | |
550 typedef typename implementation_defined::iterator iterator; | |
551 typedef typename implementation_defined::const_iterator const_iterator; | |
552 typedef typename implementation_defined::reverse_iterator reverse_iterator; | |
553 typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator; | |
554 typedef typename implementation_defined::insert_commit_data insert_commit_data; | |
555 typedef typename implementation_defined::node_traits node_traits; | |
556 typedef typename implementation_defined::node node; | |
557 typedef typename implementation_defined::node_ptr node_ptr; | |
558 typedef typename implementation_defined::const_node_ptr const_node_ptr; | |
559 typedef typename implementation_defined::node_algorithms node_algorithms; | |
560 | |
561 static const bool constant_time_size = implementation_defined::constant_time_size; | |
562 | |
563 public: | |
564 //! <b>Effects</b>: Constructs an empty treap_multiset. | |
565 //! | |
566 //! <b>Complexity</b>: Constant. | |
567 //! | |
568 //! <b>Throws</b>: If value_traits::node_traits::node | |
569 //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) | |
570 //! or the copy constructor of the value_compare object throws. | |
571 explicit treap_multiset_impl( const value_compare &cmp = value_compare() | |
572 , const priority_compare &pcmp = priority_compare() | |
573 , const value_traits &v_traits = value_traits()) | |
574 : tree_type(cmp, pcmp, v_traits) | |
575 {} | |
576 | |
577 //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type. | |
578 //! cmp must be a comparison function that induces a strict weak ordering. | |
579 //! | |
580 //! <b>Effects</b>: Constructs an empty treap_multiset and inserts elements from | |
581 //! [b, e). | |
582 //! | |
583 //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using | |
584 //! comp and otherwise N * log N, where N is std::distance(last, first). | |
585 //! | |
586 //! <b>Throws</b>: If value_traits::node_traits::node | |
587 //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) | |
588 //! or the copy constructor/operator() of the value_compare object throws. | |
589 template<class Iterator> | |
590 treap_multiset_impl( Iterator b, Iterator e | |
591 , const value_compare &cmp = value_compare() | |
592 , const priority_compare &pcmp = priority_compare() | |
593 , const value_traits &v_traits = value_traits()) | |
594 : tree_type(false, b, e, cmp, pcmp, v_traits) | |
595 {} | |
596 | |
597 //! <b>Effects</b>: to-do | |
598 //! | |
599 treap_multiset_impl(BOOST_RV_REF(treap_multiset_impl) x) | |
600 : tree_type(::boost::move(static_cast<tree_type&>(x))) | |
601 {} | |
602 | |
603 //! <b>Effects</b>: to-do | |
604 //! | |
605 treap_multiset_impl& operator=(BOOST_RV_REF(treap_multiset_impl) x) | |
606 { return static_cast<treap_multiset_impl&>(tree_type::operator=(::boost::move(static_cast<tree_type&>(x)))); } | |
607 | |
608 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
609 //! @copydoc ::boost::intrusive::treap::~treap() | |
610 ~treap_multiset_impl(); | |
611 | |
612 //! @copydoc ::boost::intrusive::treap::begin() | |
613 iterator begin(); | |
614 | |
615 //! @copydoc ::boost::intrusive::treap::begin()const | |
616 const_iterator begin() const; | |
617 | |
618 //! @copydoc ::boost::intrusive::treap::cbegin()const | |
619 const_iterator cbegin() const; | |
620 | |
621 //! @copydoc ::boost::intrusive::treap::end() | |
622 iterator end(); | |
623 | |
624 //! @copydoc ::boost::intrusive::treap::end()const | |
625 const_iterator end() const; | |
626 | |
627 //! @copydoc ::boost::intrusive::treap::cend()const | |
628 const_iterator cend() const; | |
629 | |
630 //! @copydoc ::boost::intrusive::treap::rbegin() | |
631 reverse_iterator rbegin(); | |
632 | |
633 //! @copydoc ::boost::intrusive::treap::rbegin()const | |
634 const_reverse_iterator rbegin() const; | |
635 | |
636 //! @copydoc ::boost::intrusive::treap::crbegin()const | |
637 const_reverse_iterator crbegin() const; | |
638 | |
639 //! @copydoc ::boost::intrusive::treap::rend() | |
640 reverse_iterator rend(); | |
641 | |
642 //! @copydoc ::boost::intrusive::treap::rend()const | |
643 const_reverse_iterator rend() const; | |
644 | |
645 //! @copydoc ::boost::intrusive::treap::crend()const | |
646 const_reverse_iterator crend() const; | |
647 | |
648 //! @copydoc ::boost::intrusive::treap::container_from_end_iterator(iterator) | |
649 static treap_multiset_impl &container_from_end_iterator(iterator end_iterator); | |
650 | |
651 //! @copydoc ::boost::intrusive::treap::container_from_end_iterator(const_iterator) | |
652 static const treap_multiset_impl &container_from_end_iterator(const_iterator end_iterator); | |
653 | |
654 //! @copydoc ::boost::intrusive::treap::container_from_iterator(iterator) | |
655 static treap_multiset_impl &container_from_iterator(iterator it); | |
656 | |
657 //! @copydoc ::boost::intrusive::treap::container_from_iterator(const_iterator) | |
658 static const treap_multiset_impl &container_from_iterator(const_iterator it); | |
659 | |
660 //! @copydoc ::boost::intrusive::treap::key_comp()const | |
661 key_compare key_comp() const; | |
662 | |
663 //! @copydoc ::boost::intrusive::treap::value_comp()const | |
664 value_compare value_comp() const; | |
665 | |
666 //! @copydoc ::boost::intrusive::treap::empty()const | |
667 bool empty() const; | |
668 | |
669 //! @copydoc ::boost::intrusive::treap::size()const | |
670 size_type size() const; | |
671 | |
672 //! @copydoc ::boost::intrusive::treap::swap | |
673 void swap(treap_multiset_impl& other); | |
674 | |
675 //! @copydoc ::boost::intrusive::treap::clone_from | |
676 template <class Cloner, class Disposer> | |
677 void clone_from(const treap_multiset_impl &src, Cloner cloner, Disposer disposer); | |
678 | |
679 //! @copydoc ::boost::intrusive::treap::top() | |
680 iterator top(); | |
681 | |
682 //! @copydoc ::boost::intrusive::treap::top()const | |
683 const_iterator top() const; | |
684 | |
685 //! @copydoc ::boost::intrusive::treap::ctop()const | |
686 const_iterator ctop() const; | |
687 | |
688 //! @copydoc ::boost::intrusive::treap::rtop() | |
689 reverse_iterator rtop(); | |
690 | |
691 //! @copydoc ::boost::intrusive::treap::rtop()const | |
692 const_reverse_iterator rtop() const; | |
693 | |
694 //! @copydoc ::boost::intrusive::treap::crtop()const | |
695 const_reverse_iterator crtop() const; | |
696 | |
697 //! @copydoc ::boost::intrusive::treap::crtop() const | |
698 priority_compare priority_comp() const; | |
699 #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
700 | |
701 //! @copydoc ::boost::intrusive::treap::insert_equal(reference) | |
702 iterator insert(reference value) | |
703 { return tree_type::insert_equal(value); } | |
704 | |
705 //! @copydoc ::boost::intrusive::treap::insert_equal(const_iterator,reference) | |
706 iterator insert(const_iterator hint, reference value) | |
707 { return tree_type::insert_equal(hint, value); } | |
708 | |
709 //! @copydoc ::boost::intrusive::treap::insert_equal(Iterator,Iterator) | |
710 template<class Iterator> | |
711 void insert(Iterator b, Iterator e) | |
712 { tree_type::insert_equal(b, e); } | |
713 | |
714 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
715 //! @copydoc ::boost::intrusive::treap::insert_before | |
716 iterator insert_before(const_iterator pos, reference value); | |
717 | |
718 //! @copydoc ::boost::intrusive::treap::push_back | |
719 void push_back(reference value); | |
720 | |
721 //! @copydoc ::boost::intrusive::treap::push_front | |
722 void push_front(reference value); | |
723 | |
724 //! @copydoc ::boost::intrusive::treap::erase(const_iterator) | |
725 iterator erase(const_iterator i); | |
726 | |
727 //! @copydoc ::boost::intrusive::treap::erase(const_iterator,const_iterator) | |
728 iterator erase(const_iterator b, const_iterator e); | |
729 | |
730 //! @copydoc ::boost::intrusive::treap::erase(const_reference) | |
731 size_type erase(const_reference value); | |
732 | |
733 //! @copydoc ::boost::intrusive::treap::erase(const KeyType&,KeyValueCompare) | |
734 template<class KeyType, class KeyValueCompare> | |
735 size_type erase(const KeyType& key, KeyValueCompare comp); | |
736 | |
737 //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_iterator,Disposer) | |
738 template<class Disposer> | |
739 iterator erase_and_dispose(const_iterator i, Disposer disposer); | |
740 | |
741 //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_iterator,const_iterator,Disposer) | |
742 template<class Disposer> | |
743 iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer); | |
744 | |
745 //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const_reference, Disposer) | |
746 template<class Disposer> | |
747 size_type erase_and_dispose(const_reference value, Disposer disposer); | |
748 | |
749 //! @copydoc ::boost::intrusive::treap::erase_and_dispose(const KeyType&,KeyValueCompare,Disposer) | |
750 template<class KeyType, class KeyValueCompare, class Disposer> | |
751 size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer); | |
752 | |
753 //! @copydoc ::boost::intrusive::treap::clear | |
754 void clear(); | |
755 | |
756 //! @copydoc ::boost::intrusive::treap::clear_and_dispose | |
757 template<class Disposer> | |
758 void clear_and_dispose(Disposer disposer); | |
759 | |
760 //! @copydoc ::boost::intrusive::treap::count(const_reference)const | |
761 size_type count(const_reference value) const; | |
762 | |
763 //! @copydoc ::boost::intrusive::treap::count(const KeyType&,KeyValueCompare)const | |
764 template<class KeyType, class KeyValueCompare> | |
765 size_type count(const KeyType& key, KeyValueCompare comp) const; | |
766 | |
767 //! @copydoc ::boost::intrusive::treap::lower_bound(const_reference) | |
768 iterator lower_bound(const_reference value); | |
769 | |
770 //! @copydoc ::boost::intrusive::treap::lower_bound(const KeyType&,KeyValueCompare) | |
771 template<class KeyType, class KeyValueCompare> | |
772 iterator lower_bound(const KeyType& key, KeyValueCompare comp); | |
773 | |
774 //! @copydoc ::boost::intrusive::treap::lower_bound(const_reference)const | |
775 const_iterator lower_bound(const_reference value) const; | |
776 | |
777 //! @copydoc ::boost::intrusive::treap::lower_bound(const KeyType&,KeyValueCompare)const | |
778 template<class KeyType, class KeyValueCompare> | |
779 const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const; | |
780 | |
781 //! @copydoc ::boost::intrusive::treap::upper_bound(const_reference) | |
782 iterator upper_bound(const_reference value); | |
783 | |
784 //! @copydoc ::boost::intrusive::treap::upper_bound(const KeyType&,KeyValueCompare) | |
785 template<class KeyType, class KeyValueCompare> | |
786 iterator upper_bound(const KeyType& key, KeyValueCompare comp); | |
787 | |
788 //! @copydoc ::boost::intrusive::treap::upper_bound(const_reference)const | |
789 const_iterator upper_bound(const_reference value) const; | |
790 | |
791 //! @copydoc ::boost::intrusive::treap::upper_bound(const KeyType&,KeyValueCompare)const | |
792 template<class KeyType, class KeyValueCompare> | |
793 const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const; | |
794 | |
795 //! @copydoc ::boost::intrusive::treap::find(const_reference) | |
796 iterator find(const_reference value); | |
797 | |
798 //! @copydoc ::boost::intrusive::treap::find(const KeyType&,KeyValueCompare) | |
799 template<class KeyType, class KeyValueCompare> | |
800 iterator find(const KeyType& key, KeyValueCompare comp); | |
801 | |
802 //! @copydoc ::boost::intrusive::treap::find(const_reference)const | |
803 const_iterator find(const_reference value) const; | |
804 | |
805 //! @copydoc ::boost::intrusive::treap::find(const KeyType&,KeyValueCompare)const | |
806 template<class KeyType, class KeyValueCompare> | |
807 const_iterator find(const KeyType& key, KeyValueCompare comp) const; | |
808 | |
809 //! @copydoc ::boost::intrusive::treap::equal_range(const_reference) | |
810 std::pair<iterator,iterator> equal_range(const_reference value); | |
811 | |
812 //! @copydoc ::boost::intrusive::treap::equal_range(const KeyType&,KeyValueCompare) | |
813 template<class KeyType, class KeyValueCompare> | |
814 std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp); | |
815 | |
816 //! @copydoc ::boost::intrusive::treap::equal_range(const_reference)const | |
817 std::pair<const_iterator, const_iterator> | |
818 equal_range(const_reference value) const; | |
819 | |
820 //! @copydoc ::boost::intrusive::treap::equal_range(const KeyType&,KeyValueCompare)const | |
821 template<class KeyType, class KeyValueCompare> | |
822 std::pair<const_iterator, const_iterator> | |
823 equal_range(const KeyType& key, KeyValueCompare comp) const; | |
824 | |
825 //! @copydoc ::boost::intrusive::treap::bounded_range(const_reference,const_reference,bool,bool) | |
826 std::pair<iterator,iterator> bounded_range | |
827 (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed); | |
828 | |
829 //! @copydoc ::boost::intrusive::treap::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool) | |
830 template<class KeyType, class KeyValueCompare> | |
831 std::pair<iterator,iterator> bounded_range | |
832 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed); | |
833 | |
834 //! @copydoc ::boost::intrusive::treap::bounded_range(const_reference,const_reference,bool,bool)const | |
835 std::pair<const_iterator, const_iterator> | |
836 bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const; | |
837 | |
838 //! @copydoc ::boost::intrusive::treap::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool)const | |
839 template<class KeyType, class KeyValueCompare> | |
840 std::pair<const_iterator, const_iterator> bounded_range | |
841 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const; | |
842 | |
843 //! @copydoc ::boost::intrusive::treap::s_iterator_to(reference) | |
844 static iterator s_iterator_to(reference value); | |
845 | |
846 //! @copydoc ::boost::intrusive::treap::s_iterator_to(const_reference) | |
847 static const_iterator s_iterator_to(const_reference value); | |
848 | |
849 //! @copydoc ::boost::intrusive::treap::iterator_to(reference) | |
850 iterator iterator_to(reference value); | |
851 | |
852 //! @copydoc ::boost::intrusive::treap::iterator_to(const_reference)const | |
853 const_iterator iterator_to(const_reference value) const; | |
854 | |
855 //! @copydoc ::boost::intrusive::treap::init_node(reference) | |
856 static void init_node(reference value); | |
857 | |
858 //! @copydoc ::boost::intrusive::treap::unlink_leftmost_without_rebalance | |
859 pointer unlink_leftmost_without_rebalance(); | |
860 | |
861 //! @copydoc ::boost::intrusive::treap::replace_node | |
862 void replace_node(iterator replace_this, reference with_this); | |
863 | |
864 //! @copydoc ::boost::intrusive::treap::remove_node | |
865 void remove_node(reference value); | |
866 | |
867 #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
868 }; | |
869 | |
870 | |
871 //! Helper metafunction to define a \c treap_multiset that yields to the same type when the | |
872 //! same options (either explicitly or implicitly) are used. | |
873 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
874 template<class T, class ...Options> | |
875 #else | |
876 template<class T, class O1 = void, class O2 = void | |
877 , class O3 = void, class O4 = void> | |
878 #endif | |
879 struct make_treap_multiset | |
880 { | |
881 typedef typename pack_options | |
882 < treap_defaults, | |
883 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
884 O1, O2, O3, O4 | |
885 #else | |
886 Options... | |
887 #endif | |
888 >::type packed_options; | |
889 | |
890 typedef typename detail::get_value_traits | |
891 <T, typename packed_options::proto_value_traits>::type value_traits; | |
892 | |
893 typedef treap_multiset_impl | |
894 < value_traits | |
895 , typename packed_options::compare | |
896 , typename packed_options::priority | |
897 , typename packed_options::size_type | |
898 , packed_options::constant_time_size | |
899 > implementation_defined; | |
900 /// @endcond | |
901 typedef implementation_defined type; | |
902 }; | |
903 | |
904 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED | |
905 | |
906 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
907 template<class T, class O1, class O2, class O3, class O4> | |
908 #else | |
909 template<class T, class ...Options> | |
910 #endif | |
911 class treap_multiset | |
912 : public make_treap_multiset<T, | |
913 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
914 O1, O2, O3, O4 | |
915 #else | |
916 Options... | |
917 #endif | |
918 >::type | |
919 { | |
920 typedef typename make_treap_multiset | |
921 <T, | |
922 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) | |
923 O1, O2, O3, O4 | |
924 #else | |
925 Options... | |
926 #endif | |
927 >::type Base; | |
928 BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_multiset) | |
929 | |
930 public: | |
931 typedef typename Base::value_compare value_compare; | |
932 typedef typename Base::priority_compare priority_compare; | |
933 typedef typename Base::value_traits value_traits; | |
934 typedef typename Base::iterator iterator; | |
935 typedef typename Base::const_iterator const_iterator; | |
936 | |
937 //Assert if passed value traits are compatible with the type | |
938 BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value)); | |
939 | |
940 explicit treap_multiset( const value_compare &cmp = value_compare() | |
941 , const priority_compare &pcmp = priority_compare() | |
942 , const value_traits &v_traits = value_traits()) | |
943 : Base(cmp, pcmp, v_traits) | |
944 {} | |
945 | |
946 template<class Iterator> | |
947 treap_multiset( Iterator b, Iterator e | |
948 , const value_compare &cmp = value_compare() | |
949 , const priority_compare &pcmp = priority_compare() | |
950 , const value_traits &v_traits = value_traits()) | |
951 : Base(b, e, cmp, pcmp, v_traits) | |
952 {} | |
953 | |
954 treap_multiset(BOOST_RV_REF(treap_multiset) x) | |
955 : Base(::boost::move(static_cast<Base&>(x))) | |
956 {} | |
957 | |
958 treap_multiset& operator=(BOOST_RV_REF(treap_multiset) x) | |
959 { return static_cast<treap_multiset &>(this->Base::operator=(::boost::move(static_cast<Base&>(x)))); } | |
960 | |
961 static treap_multiset &container_from_end_iterator(iterator end_iterator) | |
962 { return static_cast<treap_multiset &>(Base::container_from_end_iterator(end_iterator)); } | |
963 | |
964 static const treap_multiset &container_from_end_iterator(const_iterator end_iterator) | |
965 { return static_cast<const treap_multiset &>(Base::container_from_end_iterator(end_iterator)); } | |
966 | |
967 static treap_multiset &container_from_iterator(iterator it) | |
968 { return static_cast<treap_multiset &>(Base::container_from_iterator(it)); } | |
969 | |
970 static const treap_multiset &container_from_iterator(const_iterator it) | |
971 { return static_cast<const treap_multiset &>(Base::container_from_iterator(it)); } | |
972 }; | |
973 | |
974 #endif | |
975 | |
976 } //namespace intrusive | |
977 } //namespace boost | |
978 | |
979 #include <boost/intrusive/detail/config_end.hpp> | |
980 | |
981 #endif //BOOST_INTRUSIVE_TRIE_SET_HPP |