stl_tree.h (_Rb_tree<>::_M_erase_aux): Add.
[gcc.git] / libstdc++-v3 / include / bits / stl_multiset.h
1 // Multiset implementation -*- C++ -*-
2
3 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4 // Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
20
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
25
26 /*
27 *
28 * Copyright (c) 1994
29 * Hewlett-Packard Company
30 *
31 * Permission to use, copy, modify, distribute and sell this software
32 * and its documentation for any purpose is hereby granted without fee,
33 * provided that the above copyright notice appear in all copies and
34 * that both that copyright notice and this permission notice appear
35 * in supporting documentation. Hewlett-Packard Company makes no
36 * representations about the suitability of this software for any
37 * purpose. It is provided "as is" without express or implied warranty.
38 *
39 *
40 * Copyright (c) 1996
41 * Silicon Graphics Computer Systems, Inc.
42 *
43 * Permission to use, copy, modify, distribute and sell this software
44 * and its documentation for any purpose is hereby granted without fee,
45 * provided that the above copyright notice appear in all copies and
46 * that both that copyright notice and this permission notice appear
47 * in supporting documentation. Silicon Graphics makes no
48 * representations about the suitability of this software for any
49 * purpose. It is provided "as is" without express or implied warranty.
50 */
51
52 /** @file stl_multiset.h
53 * This is an internal header file, included by other library headers.
54 * You should not attempt to use it directly.
55 */
56
57 #ifndef _STL_MULTISET_H
58 #define _STL_MULTISET_H 1
59
60 #include <bits/concept_check.h>
61 #include <initializer_list>
62
63 _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
64
65 /**
66 * @brief A standard container made up of elements, which can be retrieved
67 * in logarithmic time.
68 *
69 * @ingroup associative_containers
70 *
71 * Meets the requirements of a <a href="tables.html#65">container</a>, a
72 * <a href="tables.html#66">reversible container</a>, and an
73 * <a href="tables.html#69">associative container</a> (using equivalent
74 * keys). For a @c multiset<Key> the key_type and value_type are Key.
75 *
76 * Multisets support bidirectional iterators.
77 *
78 * The private tree data is declared exactly the same way for set and
79 * multiset; the distinction is made entirely in how the tree functions are
80 * called (*_unique versus *_equal, same as the standard).
81 */
82 template <typename _Key, typename _Compare = std::less<_Key>,
83 typename _Alloc = std::allocator<_Key> >
84 class multiset
85 {
86 // concept requirements
87 typedef typename _Alloc::value_type _Alloc_value_type;
88 __glibcxx_class_requires(_Key, _SGIAssignableConcept)
89 __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
90 _BinaryFunctionConcept)
91 __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
92
93 public:
94 // typedefs:
95 typedef _Key key_type;
96 typedef _Key value_type;
97 typedef _Compare key_compare;
98 typedef _Compare value_compare;
99 typedef _Alloc allocator_type;
100
101 private:
102 /// This turns a red-black tree into a [multi]set.
103 typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
104
105 typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
106 key_compare, _Key_alloc_type> _Rep_type;
107 /// The actual tree structure.
108 _Rep_type _M_t;
109
110 public:
111 typedef typename _Key_alloc_type::pointer pointer;
112 typedef typename _Key_alloc_type::const_pointer const_pointer;
113 typedef typename _Key_alloc_type::reference reference;
114 typedef typename _Key_alloc_type::const_reference const_reference;
115 // _GLIBCXX_RESOLVE_LIB_DEFECTS
116 // DR 103. set::iterator is required to be modifiable,
117 // but this allows modification of keys.
118 typedef typename _Rep_type::const_iterator iterator;
119 typedef typename _Rep_type::const_iterator const_iterator;
120 typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
121 typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
122 typedef typename _Rep_type::size_type size_type;
123 typedef typename _Rep_type::difference_type difference_type;
124
125 // allocation/deallocation
126 /**
127 * @brief Default constructor creates no elements.
128 */
129 multiset()
130 : _M_t() { }
131
132 /**
133 * @brief Creates a %multiset with no elements.
134 * @param comp Comparator to use.
135 * @param a An allocator object.
136 */
137 explicit
138 multiset(const _Compare& __comp,
139 const allocator_type& __a = allocator_type())
140 : _M_t(__comp, __a) { }
141
142 /**
143 * @brief Builds a %multiset from a range.
144 * @param first An input iterator.
145 * @param last An input iterator.
146 *
147 * Create a %multiset consisting of copies of the elements from
148 * [first,last). This is linear in N if the range is already sorted,
149 * and NlogN otherwise (where N is distance(first,last)).
150 */
151 template<typename _InputIterator>
152 multiset(_InputIterator __first, _InputIterator __last)
153 : _M_t()
154 { _M_t._M_insert_equal(__first, __last); }
155
156 /**
157 * @brief Builds a %multiset from a range.
158 * @param first An input iterator.
159 * @param last An input iterator.
160 * @param comp A comparison functor.
161 * @param a An allocator object.
162 *
163 * Create a %multiset consisting of copies of the elements from
164 * [first,last). This is linear in N if the range is already sorted,
165 * and NlogN otherwise (where N is distance(first,last)).
166 */
167 template<typename _InputIterator>
168 multiset(_InputIterator __first, _InputIterator __last,
169 const _Compare& __comp,
170 const allocator_type& __a = allocator_type())
171 : _M_t(__comp, __a)
172 { _M_t._M_insert_equal(__first, __last); }
173
174 /**
175 * @brief %Multiset copy constructor.
176 * @param x A %multiset of identical element and allocator types.
177 *
178 * The newly-created %multiset uses a copy of the allocation object used
179 * by @a x.
180 */
181 multiset(const multiset& __x)
182 : _M_t(__x._M_t) { }
183
184 #ifdef __GXX_EXPERIMENTAL_CXX0X__
185 /**
186 * @brief %Multiset move constructor.
187 * @param x A %multiset of identical element and allocator types.
188 *
189 * The newly-created %multiset contains the exact contents of @a x.
190 * The contents of @a x are a valid, but unspecified %multiset.
191 */
192 multiset(multiset&& __x)
193 : _M_t(std::move(__x._M_t)) { }
194
195 /**
196 * @brief Builds a %multiset from an initializer_list.
197 * @param l An initializer_list.
198 * @param comp A comparison functor.
199 * @param a An allocator object.
200 *
201 * Create a %multiset consisting of copies of the elements from
202 * the list. This is linear in N if the list is already sorted,
203 * and NlogN otherwise (where N is @a l.size()).
204 */
205 multiset(initializer_list<value_type> __l,
206 const _Compare& __comp = _Compare(),
207 const allocator_type& __a = allocator_type())
208 : _M_t(__comp, __a)
209 { _M_t._M_insert_equal(__l.begin(), __l.end()); }
210 #endif
211
212 /**
213 * @brief %Multiset assignment operator.
214 * @param x A %multiset of identical element and allocator types.
215 *
216 * All the elements of @a x are copied, but unlike the copy constructor,
217 * the allocator object is not copied.
218 */
219 multiset&
220 operator=(const multiset& __x)
221 {
222 _M_t = __x._M_t;
223 return *this;
224 }
225
226 #ifdef __GXX_EXPERIMENTAL_CXX0X__
227 /**
228 * @brief %Multiset move assignment operator.
229 * @param x A %multiset of identical element and allocator types.
230 *
231 * The contents of @a x are moved into this %multiset (without copying).
232 * @a x is a valid, but unspecified %multiset.
233 */
234 multiset&
235 operator=(multiset&& __x)
236 {
237 // NB: DR 1204.
238 // NB: DR 675.
239 this->clear();
240 this->swap(__x);
241 return *this;
242 }
243
244 /**
245 * @brief %Multiset list assignment operator.
246 * @param l An initializer_list.
247 *
248 * This function fills a %multiset with copies of the elements in the
249 * initializer list @a l.
250 *
251 * Note that the assignment completely changes the %multiset and
252 * that the resulting %multiset's size is the same as the number
253 * of elements assigned. Old data may be lost.
254 */
255 multiset&
256 operator=(initializer_list<value_type> __l)
257 {
258 this->clear();
259 this->insert(__l.begin(), __l.end());
260 return *this;
261 }
262 #endif
263
264 // accessors:
265
266 /// Returns the comparison object.
267 key_compare
268 key_comp() const
269 { return _M_t.key_comp(); }
270 /// Returns the comparison object.
271 value_compare
272 value_comp() const
273 { return _M_t.key_comp(); }
274 /// Returns the memory allocation object.
275 allocator_type
276 get_allocator() const
277 { return _M_t.get_allocator(); }
278
279 /**
280 * Returns a read-only (constant) iterator that points to the first
281 * element in the %multiset. Iteration is done in ascending order
282 * according to the keys.
283 */
284 iterator
285 begin() const
286 { return _M_t.begin(); }
287
288 /**
289 * Returns a read-only (constant) iterator that points one past the last
290 * element in the %multiset. Iteration is done in ascending order
291 * according to the keys.
292 */
293 iterator
294 end() const
295 { return _M_t.end(); }
296
297 /**
298 * Returns a read-only (constant) reverse iterator that points to the
299 * last element in the %multiset. Iteration is done in descending order
300 * according to the keys.
301 */
302 reverse_iterator
303 rbegin() const
304 { return _M_t.rbegin(); }
305
306 /**
307 * Returns a read-only (constant) reverse iterator that points to the
308 * last element in the %multiset. Iteration is done in descending order
309 * according to the keys.
310 */
311 reverse_iterator
312 rend() const
313 { return _M_t.rend(); }
314
315 #ifdef __GXX_EXPERIMENTAL_CXX0X__
316 /**
317 * Returns a read-only (constant) iterator that points to the first
318 * element in the %multiset. Iteration is done in ascending order
319 * according to the keys.
320 */
321 iterator
322 cbegin() const
323 { return _M_t.begin(); }
324
325 /**
326 * Returns a read-only (constant) iterator that points one past the last
327 * element in the %multiset. Iteration is done in ascending order
328 * according to the keys.
329 */
330 iterator
331 cend() const
332 { return _M_t.end(); }
333
334 /**
335 * Returns a read-only (constant) reverse iterator that points to the
336 * last element in the %multiset. Iteration is done in descending order
337 * according to the keys.
338 */
339 reverse_iterator
340 crbegin() const
341 { return _M_t.rbegin(); }
342
343 /**
344 * Returns a read-only (constant) reverse iterator that points to the
345 * last element in the %multiset. Iteration is done in descending order
346 * according to the keys.
347 */
348 reverse_iterator
349 crend() const
350 { return _M_t.rend(); }
351 #endif
352
353 /// Returns true if the %set is empty.
354 bool
355 empty() const
356 { return _M_t.empty(); }
357
358 /// Returns the size of the %set.
359 size_type
360 size() const
361 { return _M_t.size(); }
362
363 /// Returns the maximum size of the %set.
364 size_type
365 max_size() const
366 { return _M_t.max_size(); }
367
368 /**
369 * @brief Swaps data with another %multiset.
370 * @param x A %multiset of the same element and allocator types.
371 *
372 * This exchanges the elements between two multisets in constant time.
373 * (It is only swapping a pointer, an integer, and an instance of the @c
374 * Compare type (which itself is often stateless and empty), so it should
375 * be quite fast.)
376 * Note that the global std::swap() function is specialized such that
377 * std::swap(s1,s2) will feed to this function.
378 */
379 void
380 swap(multiset& __x)
381 { _M_t.swap(__x._M_t); }
382
383 // insert/erase
384 /**
385 * @brief Inserts an element into the %multiset.
386 * @param x Element to be inserted.
387 * @return An iterator that points to the inserted element.
388 *
389 * This function inserts an element into the %multiset. Contrary
390 * to a std::set the %multiset does not rely on unique keys and thus
391 * multiple copies of the same element can be inserted.
392 *
393 * Insertion requires logarithmic time.
394 */
395 iterator
396 insert(const value_type& __x)
397 { return _M_t._M_insert_equal(__x); }
398
399 /**
400 * @brief Inserts an element into the %multiset.
401 * @param position An iterator that serves as a hint as to where the
402 * element should be inserted.
403 * @param x Element to be inserted.
404 * @return An iterator that points to the inserted element.
405 *
406 * This function inserts an element into the %multiset. Contrary
407 * to a std::set the %multiset does not rely on unique keys and thus
408 * multiple copies of the same element can be inserted.
409 *
410 * Note that the first parameter is only a hint and can potentially
411 * improve the performance of the insertion process. A bad hint would
412 * cause no gains in efficiency.
413 *
414 * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
415 * for more on @a hinting.
416 *
417 * Insertion requires logarithmic time (if the hint is not taken).
418 */
419 iterator
420 #ifdef __GXX_EXPERIMENTAL_CXX0X__
421 insert(const_iterator __position, const value_type& __x)
422 #else
423 insert(iterator __position, const value_type& __x)
424 #endif
425 { return _M_t._M_insert_equal_(__position, __x); }
426
427 /**
428 * @brief A template function that tries to insert a range of elements.
429 * @param first Iterator pointing to the start of the range to be
430 * inserted.
431 * @param last Iterator pointing to the end of the range.
432 *
433 * Complexity similar to that of the range constructor.
434 */
435 template<typename _InputIterator>
436 void
437 insert(_InputIterator __first, _InputIterator __last)
438 { _M_t._M_insert_equal(__first, __last); }
439
440 #ifdef __GXX_EXPERIMENTAL_CXX0X__
441 /**
442 * @brief Attempts to insert a list of elements into the %multiset.
443 * @param list A std::initializer_list<value_type> of elements
444 * to be inserted.
445 *
446 * Complexity similar to that of the range constructor.
447 */
448 void
449 insert(initializer_list<value_type> __l)
450 { this->insert(__l.begin(), __l.end()); }
451 #endif
452
453 #ifdef __GXX_EXPERIMENTAL_CXX0X__
454 // _GLIBCXX_RESOLVE_LIB_DEFECTS
455 // DR 130. Associative erase should return an iterator.
456 /**
457 * @brief Erases an element from a %multiset.
458 * @param position An iterator pointing to the element to be erased.
459 * @return An iterator pointing to the element immediately following
460 * @a position prior to the element being erased. If no such
461 * element exists, end() is returned.
462 *
463 * This function erases an element, pointed to by the given iterator,
464 * from a %multiset. Note that this function only erases the element,
465 * and that if the element is itself a pointer, the pointed-to memory is
466 * not touched in any way. Managing the pointer is the user's
467 * responsibility.
468 */
469 iterator
470 erase(const_iterator __position)
471 { return _M_t.erase(__position); }
472 #else
473 /**
474 * @brief Erases an element from a %multiset.
475 * @param position An iterator pointing to the element to be erased.
476 *
477 * This function erases an element, pointed to by the given iterator,
478 * from a %multiset. Note that this function only erases the element,
479 * and that if the element is itself a pointer, the pointed-to memory is
480 * not touched in any way. Managing the pointer is the user's
481 * responsibility.
482 */
483 void
484 erase(iterator __position)
485 { _M_t.erase(__position); }
486 #endif
487
488 /**
489 * @brief Erases elements according to the provided key.
490 * @param x Key of element to be erased.
491 * @return The number of elements erased.
492 *
493 * This function erases all elements located by the given key from a
494 * %multiset.
495 * Note that this function only erases the element, and that if
496 * the element is itself a pointer, the pointed-to memory is not touched
497 * in any way. Managing the pointer is the user's responsibility.
498 */
499 size_type
500 erase(const key_type& __x)
501 { return _M_t.erase(__x); }
502
503 #ifdef __GXX_EXPERIMENTAL_CXX0X__
504 // _GLIBCXX_RESOLVE_LIB_DEFECTS
505 // DR 130. Associative erase should return an iterator.
506 /**
507 * @brief Erases a [first,last) range of elements from a %multiset.
508 * @param first Iterator pointing to the start of the range to be
509 * erased.
510 * @param last Iterator pointing to the end of the range to be erased.
511 * @return The iterator @a last.
512 *
513 * This function erases a sequence of elements from a %multiset.
514 * Note that this function only erases the elements, and that if
515 * the elements themselves are pointers, the pointed-to memory is not
516 * touched in any way. Managing the pointer is the user's
517 * responsibility.
518 */
519 iterator
520 erase(const_iterator __first, const_iterator __last)
521 { return _M_t.erase(__first, __last); }
522 #else
523 /**
524 * @brief Erases a [first,last) range of elements from a %multiset.
525 * @param first Iterator pointing to the start of the range to be
526 * erased.
527 * @param last Iterator pointing to the end of the range to be erased.
528 *
529 * This function erases a sequence of elements from a %multiset.
530 * Note that this function only erases the elements, and that if
531 * the elements themselves are pointers, the pointed-to memory is not
532 * touched in any way. Managing the pointer is the user's
533 * responsibility.
534 */
535 void
536 erase(iterator __first, iterator __last)
537 { _M_t.erase(__first, __last); }
538 #endif
539
540 /**
541 * Erases all elements in a %multiset. Note that this function only
542 * erases the elements, and that if the elements themselves are pointers,
543 * the pointed-to memory is not touched in any way. Managing the pointer
544 * is the user's responsibility.
545 */
546 void
547 clear()
548 { _M_t.clear(); }
549
550 // multiset operations:
551
552 /**
553 * @brief Finds the number of elements with given key.
554 * @param x Key of elements to be located.
555 * @return Number of elements with specified key.
556 */
557 size_type
558 count(const key_type& __x) const
559 { return _M_t.count(__x); }
560
561 // _GLIBCXX_RESOLVE_LIB_DEFECTS
562 // 214. set::find() missing const overload
563 //@{
564 /**
565 * @brief Tries to locate an element in a %set.
566 * @param x Element to be located.
567 * @return Iterator pointing to sought-after element, or end() if not
568 * found.
569 *
570 * This function takes a key and tries to locate the element with which
571 * the key matches. If successful the function returns an iterator
572 * pointing to the sought after element. If unsuccessful it returns the
573 * past-the-end ( @c end() ) iterator.
574 */
575 iterator
576 find(const key_type& __x)
577 { return _M_t.find(__x); }
578
579 const_iterator
580 find(const key_type& __x) const
581 { return _M_t.find(__x); }
582 //@}
583
584 //@{
585 /**
586 * @brief Finds the beginning of a subsequence matching given key.
587 * @param x Key to be located.
588 * @return Iterator pointing to first element equal to or greater
589 * than key, or end().
590 *
591 * This function returns the first element of a subsequence of elements
592 * that matches the given key. If unsuccessful it returns an iterator
593 * pointing to the first element that has a greater value than given key
594 * or end() if no such element exists.
595 */
596 iterator
597 lower_bound(const key_type& __x)
598 { return _M_t.lower_bound(__x); }
599
600 const_iterator
601 lower_bound(const key_type& __x) const
602 { return _M_t.lower_bound(__x); }
603 //@}
604
605 //@{
606 /**
607 * @brief Finds the end of a subsequence matching given key.
608 * @param x Key to be located.
609 * @return Iterator pointing to the first element
610 * greater than key, or end().
611 */
612 iterator
613 upper_bound(const key_type& __x)
614 { return _M_t.upper_bound(__x); }
615
616 const_iterator
617 upper_bound(const key_type& __x) const
618 { return _M_t.upper_bound(__x); }
619 //@}
620
621 //@{
622 /**
623 * @brief Finds a subsequence matching given key.
624 * @param x Key to be located.
625 * @return Pair of iterators that possibly points to the subsequence
626 * matching given key.
627 *
628 * This function is equivalent to
629 * @code
630 * std::make_pair(c.lower_bound(val),
631 * c.upper_bound(val))
632 * @endcode
633 * (but is faster than making the calls separately).
634 *
635 * This function probably only makes sense for multisets.
636 */
637 std::pair<iterator, iterator>
638 equal_range(const key_type& __x)
639 { return _M_t.equal_range(__x); }
640
641 std::pair<const_iterator, const_iterator>
642 equal_range(const key_type& __x) const
643 { return _M_t.equal_range(__x); }
644
645 template<typename _K1, typename _C1, typename _A1>
646 friend bool
647 operator==(const multiset<_K1, _C1, _A1>&,
648 const multiset<_K1, _C1, _A1>&);
649
650 template<typename _K1, typename _C1, typename _A1>
651 friend bool
652 operator< (const multiset<_K1, _C1, _A1>&,
653 const multiset<_K1, _C1, _A1>&);
654 };
655
656 /**
657 * @brief Multiset equality comparison.
658 * @param x A %multiset.
659 * @param y A %multiset of the same type as @a x.
660 * @return True iff the size and elements of the multisets are equal.
661 *
662 * This is an equivalence relation. It is linear in the size of the
663 * multisets.
664 * Multisets are considered equivalent if their sizes are equal, and if
665 * corresponding elements compare equal.
666 */
667 template<typename _Key, typename _Compare, typename _Alloc>
668 inline bool
669 operator==(const multiset<_Key, _Compare, _Alloc>& __x,
670 const multiset<_Key, _Compare, _Alloc>& __y)
671 { return __x._M_t == __y._M_t; }
672
673 /**
674 * @brief Multiset ordering relation.
675 * @param x A %multiset.
676 * @param y A %multiset of the same type as @a x.
677 * @return True iff @a x is lexicographically less than @a y.
678 *
679 * This is a total ordering relation. It is linear in the size of the
680 * maps. The elements must be comparable with @c <.
681 *
682 * See std::lexicographical_compare() for how the determination is made.
683 */
684 template<typename _Key, typename _Compare, typename _Alloc>
685 inline bool
686 operator<(const multiset<_Key, _Compare, _Alloc>& __x,
687 const multiset<_Key, _Compare, _Alloc>& __y)
688 { return __x._M_t < __y._M_t; }
689
690 /// Returns !(x == y).
691 template<typename _Key, typename _Compare, typename _Alloc>
692 inline bool
693 operator!=(const multiset<_Key, _Compare, _Alloc>& __x,
694 const multiset<_Key, _Compare, _Alloc>& __y)
695 { return !(__x == __y); }
696
697 /// Returns y < x.
698 template<typename _Key, typename _Compare, typename _Alloc>
699 inline bool
700 operator>(const multiset<_Key,_Compare,_Alloc>& __x,
701 const multiset<_Key,_Compare,_Alloc>& __y)
702 { return __y < __x; }
703
704 /// Returns !(y < x)
705 template<typename _Key, typename _Compare, typename _Alloc>
706 inline bool
707 operator<=(const multiset<_Key, _Compare, _Alloc>& __x,
708 const multiset<_Key, _Compare, _Alloc>& __y)
709 { return !(__y < __x); }
710
711 /// Returns !(x < y)
712 template<typename _Key, typename _Compare, typename _Alloc>
713 inline bool
714 operator>=(const multiset<_Key, _Compare, _Alloc>& __x,
715 const multiset<_Key, _Compare, _Alloc>& __y)
716 { return !(__x < __y); }
717
718 /// See std::multiset::swap().
719 template<typename _Key, typename _Compare, typename _Alloc>
720 inline void
721 swap(multiset<_Key, _Compare, _Alloc>& __x,
722 multiset<_Key, _Compare, _Alloc>& __y)
723 { __x.swap(__y); }
724
725 _GLIBCXX_END_NESTED_NAMESPACE
726
727 #endif /* _STL_MULTISET_H */