• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" standalone="yes"?>
2<library-reference><header name="boost/intrusive/any_hook.hpp">
3<namespace name="boost">
4<namespace name="intrusive">
5<class name="any_base_hook"><template>
6      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
7    </template><inherit access="public">make_any_base_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Derive a class from this hook in order to store objects of that class in an intrusive container.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::any_base_hook">any_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::any_base_hook">any_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
8<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>container::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
9</method-group>
10<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
11<constructor><parameter name=""><paramtype>const <classname>any_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
12<copy-assignment><type><classname>any_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>any_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
13<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a container an assertion is raised.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
14</class><class name="any_member_hook"><template>
15      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
16    </template><inherit access="public">make_any_member_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Store this hook in a class to be inserted in an intrusive container.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
17<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>container::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
18</method-group>
19<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
20<constructor><parameter name=""><paramtype>const <classname>any_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
21<copy-assignment><type><classname>any_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>any_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
22<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a container an assertion is raised.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
23</class><struct name="any_to_avl_set_hook"><template>
24      <template-type-parameter name="BasicHook"/>
25    </template><description><para>This option setter specifies that any hook should behave as an <classname alt="boost::intrusive::avl_set">avl_set</classname> hook </para></description></struct><struct name="any_to_bs_set_hook"><template>
26      <template-type-parameter name="BasicHook"/>
27    </template><description><para>This option setter specifies that any hook should behave as a <classname alt="boost::intrusive::bs_set">bs_set</classname> hook </para></description></struct><struct name="any_to_list_hook"><template>
28      <template-type-parameter name="BasicHook"/>
29    </template><description><para>This option setter specifies that any hook should behave as an list hook </para></description></struct><struct name="any_to_set_hook"><template>
30      <template-type-parameter name="BasicHook"/>
31    </template><description><para>This option setter specifies that any hook should behave as a set hook </para></description></struct><struct name="any_to_slist_hook"><template>
32      <template-type-parameter name="BasicHook"/>
33    </template><description><para>This option setter specifies that any hook should behave as an slist hook </para></description></struct><struct name="any_to_unordered_set_hook"><template>
34      <template-type-parameter name="BasicHook"/>
35    </template><description><para>This option setter specifies that any hook should behave as an unordered set hook </para></description></struct><struct name="make_any_base_hook"><template>
36      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
37    </template><description><para>Helper metafunction to define a <computeroutput><computeroutput><classname alt="boost::intrusive::any_base_hook">any_base_hook</classname></computeroutput> that</computeroutput> yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
38</struct><struct name="make_any_member_hook"><template>
39      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
40    </template><description><para>Helper metafunction to define a <computeroutput><computeroutput><classname alt="boost::intrusive::any_member_hook">any_member_hook</classname></computeroutput> that</computeroutput> yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
41</struct>
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93</namespace>
94</namespace>
95</header>
96<header name="boost/intrusive/avl_set.hpp">
97<namespace name="boost">
98<namespace name="intrusive">
99<class name="avl_multiset"><template>
100      <template-type-parameter name="T"/>
101      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
102    </template><description><para>The class template <classname alt="boost::intrusive::avl_multiset">avl_multiset</classname> is an intrusive container, that mimics most of the interface of std::_multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
103<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
104<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
105<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
106<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
107<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
108<typedef name="reference"><type>implementation_defined::reference</type></typedef>
109<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
110<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
111<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
112<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
113<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
114<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
115<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
116<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
117<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
118<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
119<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
120<typedef name="node"><type>implementation_defined::node</type></typedef>
121<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
122<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
123<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
124<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
125<method-group name="public member functions">
126<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
127<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
128<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
129<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
130<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
131<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
132<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
133<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
134<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
135<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
136<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
137<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
138<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
139<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
140<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
141<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
142<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
143<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
144<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
145<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>avl_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
146<method name="clone_from"><type>void</type><template>
147          <template-type-parameter name="Cloner"/>
148          <template-type-parameter name="Disposer"/>
149        </template><parameter name="src"><paramtype>const <classname>avl_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
150<method name="clone_from"><type>void</type><template>
151          <template-type-parameter name="Cloner"/>
152          <template-type-parameter name="Disposer"/>
153        </template><parameter name="src"><paramtype><classname>avl_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
154<method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
155<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
156<method name="insert"><type>void</type><template>
157          <template-type-parameter name="Iterator"/>
158        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
159<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
160<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
161<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
162<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
163<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
164<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
165<method name="erase"><type>size_type</type><template>
166          <template-type-parameter name="KeyType"/>
167          <template-type-parameter name="KeyTypeKeyCompare"/>
168        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
169<method name="erase_and_dispose"><type>iterator</type><template>
170          <template-type-parameter name="Disposer"/>
171        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
172<method name="erase_and_dispose"><type>iterator</type><template>
173          <template-type-parameter name="Disposer"/>
174        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
175<method name="erase_and_dispose"><type>size_type</type><template>
176          <template-type-parameter name="Disposer"/>
177        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
178<method name="erase_and_dispose"><type>size_type</type><template>
179          <template-type-parameter name="KeyType"/>
180          <template-type-parameter name="KeyTypeKeyCompare"/>
181          <template-type-parameter name="Disposer"/>
182        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
183<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
184<method name="clear_and_dispose"><type>void</type><template>
185          <template-type-parameter name="Disposer"/>
186        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
187<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
188<method name="count" cv="const"><type>size_type</type><template>
189          <template-type-parameter name="KeyType"/>
190          <template-type-parameter name="KeyTypeKeyCompare"/>
191        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
192<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
193<method name="lower_bound"><type>iterator</type><template>
194          <template-type-parameter name="KeyType"/>
195          <template-type-parameter name="KeyTypeKeyCompare"/>
196        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
197<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
198<method name="lower_bound" cv="const"><type>const_iterator</type><template>
199          <template-type-parameter name="KeyType"/>
200          <template-type-parameter name="KeyTypeKeyCompare"/>
201        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
202<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
203<method name="upper_bound"><type>iterator</type><template>
204          <template-type-parameter name="KeyType"/>
205          <template-type-parameter name="KeyTypeKeyCompare"/>
206        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
207<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
208<method name="upper_bound" cv="const"><type>const_iterator</type><template>
209          <template-type-parameter name="KeyType"/>
210          <template-type-parameter name="KeyTypeKeyCompare"/>
211        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
212<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
213<method name="find"><type>iterator</type><template>
214          <template-type-parameter name="KeyType"/>
215          <template-type-parameter name="KeyTypeKeyCompare"/>
216        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
217<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
218<method name="find" cv="const"><type>const_iterator</type><template>
219          <template-type-parameter name="KeyType"/>
220          <template-type-parameter name="KeyTypeKeyCompare"/>
221        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
222<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
223<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
224          <template-type-parameter name="KeyType"/>
225          <template-type-parameter name="KeyTypeKeyCompare"/>
226        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
227<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
228<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
229          <template-type-parameter name="KeyType"/>
230          <template-type-parameter name="KeyTypeKeyCompare"/>
231        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
232<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
233<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
234          <template-type-parameter name="KeyType"/>
235          <template-type-parameter name="KeyTypeKeyCompare"/>
236        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
237<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;key</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
238<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
239          <template-type-parameter name="KeyType"/>
240          <template-type-parameter name="KeyTypeKeyCompare"/>
241        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
242<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
243<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
244<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
245<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
246<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
247<method name="merge"><type>void</type><template>
248          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
249        </template><parameter name="source"><paramtype><classname>avl_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
250<method name="merge"><type>void</type><template>
251          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
252        </template><parameter name="source"><paramtype><classname>avl_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
253</method-group>
254<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
255<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
256<constructor><template>
257          <template-type-parameter name="Iterator"/>
258        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
259<constructor><parameter name="x"><paramtype><classname>avl_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
260<copy-assignment><type><classname>avl_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>avl_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
261<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
262<method-group name="public static functions">
263<method name="container_from_end_iterator" specifiers="static"><type><classname>avl_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
264<method name="container_from_end_iterator" specifiers="static"><type>const <classname>avl_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
265<method name="container_from_iterator" specifiers="static"><type><classname>avl_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
266<method name="container_from_iterator" specifiers="static"><type>const <classname>avl_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
267<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
268<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
269<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
270</method-group>
271</class><class name="avl_set"><template>
272      <template-type-parameter name="T"/>
273      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
274    </template><description><para>The class template <classname alt="boost::intrusive::avl_set">avl_set</classname> is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
275<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
276<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
277<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
278<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
279<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
280<typedef name="reference"><type>implementation_defined::reference</type></typedef>
281<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
282<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
283<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
284<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
285<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
286<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
287<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
288<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
289<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
290<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
291<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
292<typedef name="node"><type>implementation_defined::node</type></typedef>
293<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
294<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
295<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
296<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
297<method-group name="public member functions">
298<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
299<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
300<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
301<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
302<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
303<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
304<method name="avlegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
305<method name="avlegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
306<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
307<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
308<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
309<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
310<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
311<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
312<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
313<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
314<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
315<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
316<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
317<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>avl_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
318<method name="clone_from"><type>void</type><template>
319          <template-type-parameter name="Cloner"/>
320          <template-type-parameter name="Disposer"/>
321        </template><parameter name="src"><paramtype>const <classname>avl_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
322<method name="clone_from"><type>void</type><template>
323          <template-type-parameter name="Cloner"/>
324          <template-type-parameter name="Disposer"/>
325        </template><parameter name="src"><paramtype><classname>avl_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
326<method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
327<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
328<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
329<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
330<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
331          <template-type-parameter name="KeyType"/>
332          <template-type-parameter name="KeyTypeKeyCompare"/>
333        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
334<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
335          <template-type-parameter name="KeyType"/>
336          <template-type-parameter name="KeyTypeKeyCompare"/>
337        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
338<method name="insert"><type>void</type><template>
339          <template-type-parameter name="Iterator"/>
340        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
341<method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
342<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
343<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
344<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
345<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
346<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
347<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
348<method name="erase"><type>size_type</type><template>
349          <template-type-parameter name="KeyType"/>
350          <template-type-parameter name="KeyTypeKeyCompare"/>
351        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
352<method name="erase_and_dispose"><type>iterator</type><template>
353          <template-type-parameter name="Disposer"/>
354        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
355<method name="erase_and_dispose"><type>iterator</type><template>
356          <template-type-parameter name="Disposer"/>
357        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
358<method name="erase_and_dispose"><type>size_type</type><template>
359          <template-type-parameter name="Disposer"/>
360        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
361<method name="erase_and_dispose"><type>size_type</type><template>
362          <template-type-parameter name="KeyType"/>
363          <template-type-parameter name="KeyTypeKeyCompare"/>
364          <template-type-parameter name="Disposer"/>
365        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
366<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
367<method name="clear_and_dispose"><type>void</type><template>
368          <template-type-parameter name="Disposer"/>
369        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
370<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
371<method name="count" cv="const"><type>size_type</type><template>
372          <template-type-parameter name="KeyType"/>
373          <template-type-parameter name="KeyTypeKeyCompare"/>
374        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
375<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
376<method name="lower_bound"><type>iterator</type><template>
377          <template-type-parameter name="KeyType"/>
378          <template-type-parameter name="KeyTypeKeyCompare"/>
379        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
380<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
381<method name="lower_bound" cv="const"><type>const_iterator</type><template>
382          <template-type-parameter name="KeyType"/>
383          <template-type-parameter name="KeyTypeKeyCompare"/>
384        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
385<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
386<method name="upper_bound"><type>iterator</type><template>
387          <template-type-parameter name="KeyType"/>
388          <template-type-parameter name="KeyTypeKeyCompare"/>
389        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
390<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
391<method name="upper_bound" cv="const"><type>const_iterator</type><template>
392          <template-type-parameter name="KeyType"/>
393          <template-type-parameter name="KeyTypeKeyCompare"/>
394        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
395<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
396<method name="find"><type>iterator</type><template>
397          <template-type-parameter name="KeyType"/>
398          <template-type-parameter name="KeyTypeKeyCompare"/>
399        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
400<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
401<method name="find" cv="const"><type>const_iterator</type><template>
402          <template-type-parameter name="KeyType"/>
403          <template-type-parameter name="KeyTypeKeyCompare"/>
404        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
405<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
406<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
407          <template-type-parameter name="KeyType"/>
408          <template-type-parameter name="KeyTypeKeyCompare"/>
409        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
410<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
411<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
412          <template-type-parameter name="KeyType"/>
413          <template-type-parameter name="KeyTypeKeyCompare"/>
414        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
415<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
416<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
417          <template-type-parameter name="KeyType"/>
418          <template-type-parameter name="KeyTypeKeyCompare"/>
419        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
420<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
421<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
422          <template-type-parameter name="KeyType"/>
423          <template-type-parameter name="KeyTypeKeyCompare"/>
424        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
425<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
426<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
427<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
428<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
429<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
430<method name="merge"><type>void</type><template>
431          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
432        </template><parameter name="source"><paramtype><classname>avl_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
433<method name="merge"><type>void</type><template>
434          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
435        </template><parameter name="source"><paramtype><classname>avl_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
436</method-group>
437<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
438<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
439<constructor><template>
440          <template-type-parameter name="Iterator"/>
441        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
442<constructor><parameter name="x"><paramtype><classname>avl_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
443<copy-assignment><type><classname>avl_set</classname> &amp;</type><parameter name="x"><paramtype><classname>avl_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
444<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
445<method-group name="public static functions">
446<method name="container_from_end_iterator" specifiers="static"><type><classname>avl_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
447<method name="container_from_end_iterator" specifiers="static"><type>const <classname>avl_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
448<method name="container_from_iterator" specifiers="static"><type><classname>avl_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
449<method name="container_from_iterator" specifiers="static"><type>const <classname>avl_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
450<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
451<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
452<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
453</method-group>
454</class><struct name="make_avl_multiset"><template>
455      <template-type-parameter name="T"/>
456      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
457    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::avl_multiset">avl_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
458</struct><struct name="make_avl_set"><template>
459      <template-type-parameter name="T"/>
460      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
461    </template><description><para>Helper metafunction to define a <computeroutput>set</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
462</struct>
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504<function name="operator!="><type>bool</type><template>
505          <template-type-parameter name="T"/>
506          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
507        </template><parameter name="x"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
508<function name="operator&gt;"><type>bool</type><template>
509          <template-type-parameter name="T"/>
510          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
511        </template><parameter name="x"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
512<function name="operator&lt;="><type>bool</type><template>
513          <template-type-parameter name="T"/>
514          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
515        </template><parameter name="x"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
516<function name="operator&gt;="><type>bool</type><template>
517          <template-type-parameter name="T"/>
518          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
519        </template><parameter name="x"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
520<function name="swap"><type>void</type><template>
521          <template-type-parameter name="T"/>
522          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
523        </template><parameter name="x"><paramtype><classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
524<function name="operator!="><type>bool</type><template>
525          <template-type-parameter name="T"/>
526          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
527        </template><parameter name="x"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
528<function name="operator&gt;"><type>bool</type><template>
529          <template-type-parameter name="T"/>
530          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
531        </template><parameter name="x"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
532<function name="operator&lt;="><type>bool</type><template>
533          <template-type-parameter name="T"/>
534          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
535        </template><parameter name="x"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
536<function name="operator&gt;="><type>bool</type><template>
537          <template-type-parameter name="T"/>
538          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
539        </template><parameter name="x"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
540<function name="swap"><type>void</type><template>
541          <template-type-parameter name="T"/>
542          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
543        </template><parameter name="x"><paramtype><classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
544</namespace>
545</namespace>
546</header>
547<header name="boost/intrusive/avl_set_hook.hpp">
548<namespace name="boost">
549<namespace name="intrusive">
550<class name="avl_set_base_hook"><template>
551      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
552    </template><inherit access="public">make_avl_set_base_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::avl_set_base_hook">avl_set_base_hook</classname> in order to store objects in in an avl_set/avl_multiset. <classname alt="boost::intrusive::avl_set_base_hook">avl_set_base_hook</classname> holds the data necessary to maintain the avl_set/avl_multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for avl_set/avl_multiset.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>optimize_size&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>optimize_size&lt;&gt;</computeroutput> will tell the hook to optimize the hook for size instead of speed. </para></description><method-group name="public member functions">
553<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>avl_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
554<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
555<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
556</method-group>
557<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
558<constructor><parameter name=""><paramtype>const <classname>avl_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
559<copy-assignment><type><classname>avl_set_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>avl_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
560<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
561</class><class name="avl_set_member_hook"><template>
562      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
563    </template><inherit access="public">make_avl_set_member_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::avl_set_member_hook">avl_set_member_hook</classname> in order to store objects of this class in an avl_set/avl_multiset. <classname alt="boost::intrusive::avl_set_member_hook">avl_set_member_hook</classname> holds the data necessary for maintaining the avl_set/avl_multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for avl_set/avl_multiset.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>optimize_size&lt;&gt;</computeroutput>.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>optimize_size&lt;&gt;</computeroutput> will tell the hook to optimize the hook for size instead of speed. </para></description><method-group name="public member functions">
564<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>avl_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
565<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
566<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
567</method-group>
568<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
569<constructor><parameter name=""><paramtype>const <classname>avl_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
570<copy-assignment><type><classname>avl_set_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>avl_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
571<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
572</class><struct name="make_avl_set_base_hook"><template>
573      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
574    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::avl_set_base_hook">avl_set_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
575</struct><struct name="make_avl_set_member_hook"><template>
576      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
577    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::avl_set_member_hook">avl_set_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
578</struct>
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630</namespace>
631</namespace>
632</header>
633<header name="boost/intrusive/avltree.hpp">
634<namespace name="boost">
635<namespace name="intrusive">
636<class name="avltree"><template>
637      <template-type-parameter name="T"/>
638      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
639    </template><description><para>The class template avltree is an intrusive AVL tree container, that is used to construct intrusive <classname alt="boost::intrusive::avl_set">avl_set</classname> and <classname alt="boost::intrusive::avl_multiset">avl_multiset</classname> containers. The no-throw guarantee holds only, if the key_compare object doesn't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
640<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
641<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
642<typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
643<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
644<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
645<typedef name="reference"><type>implementation_defined::reference</type></typedef>
646<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
647<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
648<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
649<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
650<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
651<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
652<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
653<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
654<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
655<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
656<typedef name="node"><type>implementation_defined::node</type></typedef>
657<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
658<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
659<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
660<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
661<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
662<method-group name="public member functions">
663<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
664<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
665<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
666<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
667<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
668<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
669<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
670<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
671<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
672<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
673<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
674<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
675<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
676<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
677<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
678<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
679<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
680<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
681<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
682<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>avltree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
683<method name="clone_from"><type>void</type><template>
684          <template-type-parameter name="Cloner"/>
685          <template-type-parameter name="Disposer"/>
686        </template><parameter name="src"><paramtype>const <classname>avltree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
687<method name="clone_from"><type>void</type><template>
688          <template-type-parameter name="Cloner"/>
689          <template-type-parameter name="Disposer"/>
690        </template><parameter name="src"><paramtype><classname>avltree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
691<method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
692<method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
693<method name="insert_equal"><type>void</type><template>
694          <template-type-parameter name="Iterator"/>
695        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
696<method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
697<method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
698<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
699          <template-type-parameter name="KeyType"/>
700          <template-type-parameter name="KeyTypeKeyCompare"/>
701        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
702<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
703          <template-type-parameter name="KeyType"/>
704          <template-type-parameter name="KeyTypeKeyCompare"/>
705        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
706<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
707<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
708<method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
709<method name="insert_unique"><type>void</type><template>
710          <template-type-parameter name="Iterator"/>
711        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
712<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
713<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
714<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
715<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
716<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
717<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
718<method name="erase"><type>size_type</type><template>
719          <template-type-parameter name="KeyType"/>
720          <template-type-parameter name="KeyTypeKeyCompare"/>
721        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
722<method name="erase_and_dispose"><type>iterator</type><template>
723          <template-type-parameter name="Disposer"/>
724        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
725<method name="erase_and_dispose"><type>iterator</type><template>
726          <template-type-parameter name="Disposer"/>
727        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
728<method name="erase_and_dispose"><type>size_type</type><template>
729          <template-type-parameter name="Disposer"/>
730        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
731<method name="erase_and_dispose"><type>size_type</type><template>
732          <template-type-parameter name="KeyType"/>
733          <template-type-parameter name="KeyTypeKeyCompare"/>
734          <template-type-parameter name="Disposer"/>
735        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
736<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
737<method name="clear_and_dispose"><type>void</type><template>
738          <template-type-parameter name="Disposer"/>
739        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
740<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
741<method name="count" cv="const"><type>size_type</type><template>
742          <template-type-parameter name="KeyType"/>
743          <template-type-parameter name="KeyTypeKeyCompare"/>
744        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
745<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
746<method name="lower_bound"><type>iterator</type><template>
747          <template-type-parameter name="KeyType"/>
748          <template-type-parameter name="KeyTypeKeyCompare"/>
749        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
750<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
751<method name="lower_bound" cv="const"><type>const_iterator</type><template>
752          <template-type-parameter name="KeyType"/>
753          <template-type-parameter name="KeyTypeKeyCompare"/>
754        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
755<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
756<method name="upper_bound"><type>iterator</type><template>
757          <template-type-parameter name="KeyType"/>
758          <template-type-parameter name="KeyTypeKeyCompare"/>
759        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
760<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
761<method name="upper_bound" cv="const"><type>const_iterator</type><template>
762          <template-type-parameter name="KeyType"/>
763          <template-type-parameter name="KeyTypeKeyCompare"/>
764        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
765<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
766<method name="find"><type>iterator</type><template>
767          <template-type-parameter name="KeyType"/>
768          <template-type-parameter name="KeyTypeKeyCompare"/>
769        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
770<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
771<method name="find" cv="const"><type>const_iterator</type><template>
772          <template-type-parameter name="KeyType"/>
773          <template-type-parameter name="KeyTypeKeyCompare"/>
774        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
775<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
776<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
777          <template-type-parameter name="KeyType"/>
778          <template-type-parameter name="KeyTypeKeyCompare"/>
779        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
780<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
781<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
782          <template-type-parameter name="KeyType"/>
783          <template-type-parameter name="KeyTypeKeyCompare"/>
784        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
785<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
786<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
787          <template-type-parameter name="KeyType"/>
788          <template-type-parameter name="KeyTypeKeyCompare"/>
789        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
790<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
791<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
792          <template-type-parameter name="KeyType"/>
793          <template-type-parameter name="KeyTypeKeyCompare"/>
794        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
795<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
796<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
797<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
798<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
799<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
800<method name="merge_unique"><type>void</type><template>
801          <template-type-parameter name="T"/>
802          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
803        </template><parameter name=""><paramtype><classname>avltree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
804<method name="merge_equal"><type>void</type><template>
805          <template-type-parameter name="T"/>
806          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
807        </template><parameter name=""><paramtype><classname>avltree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
808</method-group>
809<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
810<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
811<constructor><template>
812          <template-type-parameter name="Iterator"/>
813        </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
814<constructor><parameter name="x"><paramtype><classname>avltree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
815<copy-assignment><type><classname>avltree</classname> &amp;</type><parameter name="x"><paramtype><classname>avltree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
816<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
817<method-group name="public static functions">
818<method name="container_from_end_iterator" specifiers="static"><type><classname>avltree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
819<method name="container_from_end_iterator" specifiers="static"><type>const <classname>avltree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
820<method name="container_from_iterator" specifiers="static"><type><classname>avltree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
821<method name="container_from_iterator" specifiers="static"><type>const <classname>avltree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
822<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
823<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
824<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
825</method-group>
826</class><struct name="make_avltree"><template>
827      <template-type-parameter name="T"/>
828      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
829    </template><description><para>Helper metafunction to define a <computeroutput>avltree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
830</struct>
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882</namespace>
883</namespace>
884</header>
885<header name="boost/intrusive/avltree_algorithms.hpp">
886<namespace name="boost">
887<namespace name="intrusive">
888<class name="avltree_algorithms"><template>
889      <template-type-parameter name="NodeTraits"/>
890    </template><description><para><classname alt="boost::intrusive::avltree_algorithms">avltree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><computeroutput>balance</computeroutput>: The type of the balance factor</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput></para><para><computeroutput>static balance get_balance(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_balance(node_ptr n, balance b);</computeroutput></para><para><computeroutput>static balance negative();</computeroutput></para><para><computeroutput>static balance zero();</computeroutput></para><para><computeroutput>static balance positive();</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
891<typedef name="node_traits"><type>NodeTraits</type></typedef>
892<typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
893<typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
894<typedef name="balance"><type>NodeTraits::balance</type></typedef>
895<typedef name="insert_commit_data"><description><para>This type is the information that will be filled by insert_unique_check </para></description><type>bstree_algo::insert_commit_data</type></typedef>
896<method-group name="public static functions">
897<method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
898<method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
899<method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
900<method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
901<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
902<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
903<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
904<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
905<method name="unlink" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
906<method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
907<method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
908<method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
909<method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
910<method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
911<method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
912<method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
913<method name="erase" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
914<method name="transfer_unique" specifiers="static"><type>bool</type><template>
915          <template-type-parameter name="NodePtrCompare"/>
916        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
917<method name="transfer_equal" specifiers="static"><type>void</type><template>
918          <template-type-parameter name="NodePtrCompare"/>
919        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
920<method name="clone" specifiers="static"><type>void</type><template>
921          <template-type-parameter name="Cloner"/>
922          <template-type-parameter name="Disposer"/>
923        </template><parameter name="source_header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
924<method name="clear_and_dispose" specifiers="static"><type>void</type><template>
925          <template-type-parameter name="Disposer"/>
926        </template><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
927<method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
928          <template-type-parameter name="KeyType"/>
929          <template-type-parameter name="KeyNodePtrCompare"/>
930        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
931<method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
932          <template-type-parameter name="KeyType"/>
933          <template-type-parameter name="KeyNodePtrCompare"/>
934        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
935<method name="find" specifiers="static"><type>node_ptr</type><template>
936          <template-type-parameter name="KeyType"/>
937          <template-type-parameter name="KeyNodePtrCompare"/>
938        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
939<method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
940          <template-type-parameter name="KeyType"/>
941          <template-type-parameter name="KeyNodePtrCompare"/>
942        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
943<method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
944          <template-type-parameter name="KeyType"/>
945          <template-type-parameter name="KeyNodePtrCompare"/>
946        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
947<method name="count" specifiers="static"><type>std::size_t</type><template>
948          <template-type-parameter name="KeyType"/>
949          <template-type-parameter name="KeyNodePtrCompare"/>
950        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
951<method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
952          <template-type-parameter name="NodePtrCompare"/>
953        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
954<method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
955          <template-type-parameter name="NodePtrCompare"/>
956        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
957<method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
958          <template-type-parameter name="NodePtrCompare"/>
959        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
960<method name="insert_before" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
961<method name="push_back" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
962<method name="push_front" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
963<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
964          <template-type-parameter name="KeyType"/>
965          <template-type-parameter name="KeyNodePtrCompare"/>
966        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
967<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
968          <template-type-parameter name="KeyType"/>
969          <template-type-parameter name="KeyNodePtrCompare"/>
970        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="hint"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
971<method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
972<method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
973</method-group>
974</class>
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026</namespace>
1027</namespace>
1028</header>
1029<header name="boost/intrusive/bs_set.hpp">
1030<namespace name="boost">
1031<namespace name="intrusive">
1032<class name="bs_multiset"><template>
1033      <template-type-parameter name="T"/>
1034      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1035    </template><description><para>The class template <classname alt="boost::intrusive::bs_multiset">bs_multiset</classname> is an intrusive container, that mimics most of the interface of std::multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
1036<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
1037<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
1038<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
1039<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
1040<typedef name="reference"><type>implementation_defined::reference</type></typedef>
1041<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
1042<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
1043<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
1044<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
1045<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
1046<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
1047<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
1048<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
1049<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
1050<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
1051<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
1052<typedef name="node"><type>implementation_defined::node</type></typedef>
1053<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
1054<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
1055<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
1056<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
1057<method-group name="public member functions">
1058<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1059<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1060<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1061<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1062<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1063<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1064<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1065<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1066<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1067<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1068<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1069<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1070<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1071<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1072<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1073<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
1074<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
1075<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1076<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1077<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>bs_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
1078<method name="clone_from"><type>void</type><template>
1079          <template-type-parameter name="Cloner"/>
1080          <template-type-parameter name="Disposer"/>
1081        </template><parameter name="src"><paramtype>const <classname>bs_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
1082<method name="clone_from"><type>void</type><template>
1083          <template-type-parameter name="Cloner"/>
1084          <template-type-parameter name="Disposer"/>
1085        </template><parameter name="src"><paramtype><classname>bs_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
1086<method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1087<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1088<method name="insert"><type>void</type><template>
1089          <template-type-parameter name="Iterator"/>
1090        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1091<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
1092<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
1093<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
1094<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1095<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1096<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1097<method name="erase"><type>size_type</type><template>
1098          <template-type-parameter name="KeyType"/>
1099          <template-type-parameter name="KeyTypeKeyCompare"/>
1100        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1101<method name="erase_and_dispose"><type>iterator</type><template>
1102          <template-type-parameter name="Disposer"/>
1103        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
1104<method name="erase_and_dispose"><type>iterator</type><template>
1105          <template-type-parameter name="Disposer"/>
1106        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
1107<method name="erase_and_dispose"><type>size_type</type><template>
1108          <template-type-parameter name="Disposer"/>
1109        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1110<method name="erase_and_dispose"><type>size_type</type><template>
1111          <template-type-parameter name="KeyType"/>
1112          <template-type-parameter name="KeyTypeKeyCompare"/>
1113          <template-type-parameter name="Disposer"/>
1114        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
1115<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1116<method name="clear_and_dispose"><type>void</type><template>
1117          <template-type-parameter name="Disposer"/>
1118        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
1119<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1120<method name="count" cv="const"><type>size_type</type><template>
1121          <template-type-parameter name="KeyType"/>
1122          <template-type-parameter name="KeyTypeKeyCompare"/>
1123        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1124<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1125<method name="lower_bound"><type>iterator</type><template>
1126          <template-type-parameter name="KeyType"/>
1127          <template-type-parameter name="KeyTypeKeyCompare"/>
1128        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1129<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1130<method name="lower_bound" cv="const"><type>const_iterator</type><template>
1131          <template-type-parameter name="KeyType"/>
1132          <template-type-parameter name="KeyTypeKeyCompare"/>
1133        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1134<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1135<method name="upper_bound"><type>iterator</type><template>
1136          <template-type-parameter name="KeyType"/>
1137          <template-type-parameter name="KeyTypeKeyCompare"/>
1138        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1139<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1140<method name="upper_bound" cv="const"><type>const_iterator</type><template>
1141          <template-type-parameter name="KeyType"/>
1142          <template-type-parameter name="KeyTypeKeyCompare"/>
1143        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1144<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1145<method name="find"><type>iterator</type><template>
1146          <template-type-parameter name="KeyType"/>
1147          <template-type-parameter name="KeyTypeKeyCompare"/>
1148        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1149<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1150<method name="find" cv="const"><type>const_iterator</type><template>
1151          <template-type-parameter name="KeyType"/>
1152          <template-type-parameter name="KeyTypeKeyCompare"/>
1153        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1154<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1155<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
1156          <template-type-parameter name="KeyType"/>
1157          <template-type-parameter name="KeyTypeKeyCompare"/>
1158        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1159<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1160<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
1161          <template-type-parameter name="KeyType"/>
1162          <template-type-parameter name="KeyTypeKeyCompare"/>
1163        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1164<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1165<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
1166          <template-type-parameter name="KeyType"/>
1167          <template-type-parameter name="KeyTypeKeyCompare"/>
1168        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1169<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1170<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
1171          <template-type-parameter name="KeyType"/>
1172          <template-type-parameter name="KeyTypeKeyCompare"/>
1173        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1174<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1175<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1176<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
1177<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
1178<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
1179<method name="merge"><type>void</type><template>
1180          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
1181        </template><parameter name="source"><paramtype><classname>bs_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
1182<method name="merge"><type>void</type><template>
1183          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
1184        </template><parameter name="source"><paramtype><classname>bs_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
1185</method-group>
1186<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
1187<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
1188<constructor><template>
1189          <template-type-parameter name="Iterator"/>
1190        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
1191<constructor><parameter name="x"><paramtype><classname>bs_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
1192<copy-assignment><type><classname>bs_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>bs_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
1193<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
1194<method-group name="public static functions">
1195<method name="container_from_end_iterator" specifiers="static"><type><classname>bs_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
1196<method name="container_from_end_iterator" specifiers="static"><type>const <classname>bs_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
1197<method name="container_from_iterator" specifiers="static"><type><classname>bs_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
1198<method name="container_from_iterator" specifiers="static"><type>const <classname>bs_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
1199<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
1200<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
1201<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
1202</method-group>
1203</class><class name="bs_set"><template>
1204      <template-type-parameter name="T"/>
1205      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1206    </template><description><para>The class template <classname alt="boost::intrusive::bs_set">bs_set</classname> is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
1207<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
1208<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
1209<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
1210<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
1211<typedef name="reference"><type>implementation_defined::reference</type></typedef>
1212<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
1213<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
1214<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
1215<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
1216<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
1217<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
1218<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
1219<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
1220<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
1221<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
1222<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
1223<typedef name="node"><type>implementation_defined::node</type></typedef>
1224<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
1225<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
1226<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
1227<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
1228<method-group name="public member functions">
1229<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1230<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1231<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1232<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1233<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1234<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1235<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1236<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1237<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1238<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1239<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1240<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1241<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1242<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1243<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1244<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
1245<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
1246<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1247<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1248<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>bs_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
1249<method name="clone_from"><type>void</type><template>
1250          <template-type-parameter name="Cloner"/>
1251          <template-type-parameter name="Disposer"/>
1252        </template><parameter name="src"><paramtype>const <classname>bs_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
1253<method name="clone_from"><type>void</type><template>
1254          <template-type-parameter name="Cloner"/>
1255          <template-type-parameter name="Disposer"/>
1256        </template><parameter name="src"><paramtype><classname>bs_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
1257<method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1258<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1259<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
1260<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
1261<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
1262          <template-type-parameter name="KeyType"/>
1263          <template-type-parameter name="KeyTypeKeyCompare"/>
1264        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
1265<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
1266          <template-type-parameter name="KeyType"/>
1267          <template-type-parameter name="KeyTypeKeyCompare"/>
1268        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
1269<method name="insert"><type>void</type><template>
1270          <template-type-parameter name="Iterator"/>
1271        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1272<method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
1273<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
1274<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
1275<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
1276<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1277<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1278<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1279<method name="erase"><type>size_type</type><template>
1280          <template-type-parameter name="KeyType"/>
1281          <template-type-parameter name="KeyTypeKeyCompare"/>
1282        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1283<method name="erase_and_dispose"><type>iterator</type><template>
1284          <template-type-parameter name="Disposer"/>
1285        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
1286<method name="erase_and_dispose"><type>iterator</type><template>
1287          <template-type-parameter name="Disposer"/>
1288        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
1289<method name="erase_and_dispose"><type>size_type</type><template>
1290          <template-type-parameter name="Disposer"/>
1291        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1292<method name="erase_and_dispose"><type>size_type</type><template>
1293          <template-type-parameter name="KeyType"/>
1294          <template-type-parameter name="KeyTypeKeyCompare"/>
1295          <template-type-parameter name="Disposer"/>
1296        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
1297<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1298<method name="clear_and_dispose"><type>void</type><template>
1299          <template-type-parameter name="Disposer"/>
1300        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
1301<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1302<method name="count" cv="const"><type>size_type</type><template>
1303          <template-type-parameter name="KeyType"/>
1304          <template-type-parameter name="KeyTypeKeyCompare"/>
1305        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1306<method name="lower_bound"><type>iterator</type><parameter name=""><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1307<method name="lower_bound"><type>iterator</type><template>
1308          <template-type-parameter name="KeyType"/>
1309          <template-type-parameter name="KeyTypeKeyCompare"/>
1310        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1311<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1312<method name="lower_bound" cv="const"><type>const_iterator</type><template>
1313          <template-type-parameter name="KeyType"/>
1314          <template-type-parameter name="KeyTypeKeyCompare"/>
1315        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1316<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1317<method name="upper_bound"><type>iterator</type><template>
1318          <template-type-parameter name="KeyType"/>
1319          <template-type-parameter name="KeyTypeKeyCompare"/>
1320        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1321<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1322<method name="upper_bound" cv="const"><type>const_iterator</type><template>
1323          <template-type-parameter name="KeyType"/>
1324          <template-type-parameter name="KeyTypeKeyCompare"/>
1325        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1326<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1327<method name="find"><type>iterator</type><template>
1328          <template-type-parameter name="KeyType"/>
1329          <template-type-parameter name="KeyTypeKeyCompare"/>
1330        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1331<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1332<method name="find" cv="const"><type>const_iterator</type><template>
1333          <template-type-parameter name="KeyType"/>
1334          <template-type-parameter name="KeyTypeKeyCompare"/>
1335        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1336<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1337<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
1338          <template-type-parameter name="KeyType"/>
1339          <template-type-parameter name="KeyTypeKeyCompare"/>
1340        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1341<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1342<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
1343          <template-type-parameter name="KeyType"/>
1344          <template-type-parameter name="KeyTypeKeyCompare"/>
1345        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1346<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1347<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
1348          <template-type-parameter name="KeyType"/>
1349          <template-type-parameter name="KeyTypeKeyCompare"/>
1350        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1351<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1352<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
1353          <template-type-parameter name="KeyType"/>
1354          <template-type-parameter name="KeyTypeKeyCompare"/>
1355        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1356<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1357<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1358<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
1359<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
1360<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
1361<method name="merge"><type>void</type><template>
1362          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
1363        </template><parameter name="source"><paramtype><classname>bs_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
1364<method name="merge"><type>void</type><template>
1365          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
1366        </template><parameter name="source"><paramtype><classname>bs_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
1367</method-group>
1368<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
1369<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
1370<constructor><template>
1371          <template-type-parameter name="Iterator"/>
1372        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
1373<constructor><parameter name="x"><paramtype><classname>bs_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
1374<copy-assignment><type><classname>bs_set</classname> &amp;</type><parameter name="x"><paramtype><classname>bs_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
1375<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
1376<method-group name="public static functions">
1377<method name="container_from_end_iterator" specifiers="static"><type><classname>bs_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
1378<method name="container_from_end_iterator" specifiers="static"><type>const <classname>bs_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
1379<method name="container_from_iterator" specifiers="static"><type><classname>bs_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
1380<method name="container_from_iterator" specifiers="static"><type>const <classname>bs_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
1381<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
1382<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
1383<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
1384</method-group>
1385</class><struct name="make_bs_multiset"><template>
1386      <template-type-parameter name="T"/>
1387      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1388    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::bs_multiset">bs_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
1389</struct><struct name="make_bs_set"><template>
1390      <template-type-parameter name="T"/>
1391      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1392    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::bs_set">bs_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
1393</struct>
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425<function name="operator!="><type>bool</type><template>
1426          <template-type-parameter name="T"/>
1427          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1428        </template><parameter name="x"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1429<function name="operator&gt;"><type>bool</type><template>
1430          <template-type-parameter name="T"/>
1431          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1432        </template><parameter name="x"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1433<function name="operator&lt;="><type>bool</type><template>
1434          <template-type-parameter name="T"/>
1435          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1436        </template><parameter name="x"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1437<function name="operator&gt;="><type>bool</type><template>
1438          <template-type-parameter name="T"/>
1439          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1440        </template><parameter name="x"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1441<function name="swap"><type>void</type><template>
1442          <template-type-parameter name="T"/>
1443          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1444        </template><parameter name="x"><paramtype><classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1445<function name="operator!="><type>bool</type><template>
1446          <template-type-parameter name="T"/>
1447          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1448        </template><parameter name="x"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1449<function name="operator&gt;"><type>bool</type><template>
1450          <template-type-parameter name="T"/>
1451          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1452        </template><parameter name="x"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1453<function name="operator&lt;="><type>bool</type><template>
1454          <template-type-parameter name="T"/>
1455          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1456        </template><parameter name="x"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1457<function name="operator&gt;="><type>bool</type><template>
1458          <template-type-parameter name="T"/>
1459          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1460        </template><parameter name="x"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1461<function name="swap"><type>void</type><template>
1462          <template-type-parameter name="T"/>
1463          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1464        </template><parameter name="x"><paramtype><classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475</namespace>
1476</namespace>
1477</header>
1478<header name="boost/intrusive/bs_set_hook.hpp">
1479<namespace name="boost">
1480<namespace name="intrusive">
1481<class name="bs_set_base_hook"><template>
1482      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1483    </template><inherit access="public">make_bs_set_base_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::bs_set_base_hook">bs_set_base_hook</classname> in order to store objects in in a bs_set/bs_multiset. <classname alt="boost::intrusive::bs_set_base_hook">bs_set_base_hook</classname> holds the data necessary to maintain the bs_set/bs_multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for bs_set/bs_multiset.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>). </para></description><method-group name="public member functions">
1484<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>bs_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1485<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
1486<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1487</method-group>
1488<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
1489<constructor><parameter name=""><paramtype>const <classname>bs_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
1490<copy-assignment><type><classname>bs_set_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>bs_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
1491<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
1492</class><class name="bs_set_member_hook"><template>
1493      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1494    </template><inherit access="public">make_bs_set_member_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::bs_set_member_hook">bs_set_member_hook</classname> in order to store objects of this class in a bs_set/bs_multiset. <classname alt="boost::intrusive::bs_set_member_hook">bs_set_member_hook</classname> holds the data necessary for maintaining the bs_set/bs_multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for bs_set/bs_multiset.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>). </para></description><method-group name="public member functions">
1495<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>bs_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1496<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
1497<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1498</method-group>
1499<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
1500<constructor><parameter name=""><paramtype>const <classname>bs_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
1501<copy-assignment><type><classname>bs_set_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>bs_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
1502<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
1503</class><struct name="make_bs_set_base_hook"><template>
1504      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1505    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::bs_set_base_hook">bs_set_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
1506</struct><struct name="make_bs_set_member_hook"><template>
1507      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1508    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::bs_set_member_hook">bs_set_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
1509</struct>
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561</namespace>
1562</namespace>
1563</header>
1564<header name="boost/intrusive/bstree.hpp">
1565<namespace name="boost">
1566<namespace name="intrusive">
1567<class name="bstree"><template>
1568      <template-type-parameter name="T"/>
1569      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1570    </template><inherit access="public">bstbase&lt; ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, ConstantTimeSize, SizeType, AlgoType, HeaderHolder &gt;</inherit><description><para>The class template bstree is an unbalanced intrusive binary search tree container. The no-throw guarantee holds only, if the key_compare object doesn't throw.</para><para>The complexity guarantees only hold if the tree is balanced, logarithmic complexity would increase to linear if the tree is totally unbalanced.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>implementation_defined</type></typedef>
1571<typedef name="pointer"><type>implementation_defined</type></typedef>
1572<typedef name="const_pointer"><type>implementation_defined</type></typedef>
1573<typedef name="value_type"><type>implementation_defined</type></typedef>
1574<typedef name="key_type"><type>implementation_defined</type></typedef>
1575<typedef name="key_of_value"><type>implementation_defined</type></typedef>
1576<typedef name="reference"><type>implementation_defined</type></typedef>
1577<typedef name="const_reference"><type>implementation_defined</type></typedef>
1578<typedef name="difference_type"><type>implementation_defined</type></typedef>
1579<typedef name="size_type"><type>implementation_defined</type></typedef>
1580<typedef name="value_compare"><type>implementation_defined</type></typedef>
1581<typedef name="key_compare"><type>implementation_defined</type></typedef>
1582<typedef name="iterator"><type>implementation_defined</type></typedef>
1583<typedef name="const_iterator"><type>implementation_defined</type></typedef>
1584<typedef name="reverse_iterator"><type>implementation_defined</type></typedef>
1585<typedef name="const_reverse_iterator"><type>implementation_defined</type></typedef>
1586<typedef name="node_traits"><type>implementation_defined</type></typedef>
1587<typedef name="node"><type>implementation_defined</type></typedef>
1588<typedef name="node_ptr"><type>implementation_defined</type></typedef>
1589<typedef name="const_node_ptr"><type>implementation_defined</type></typedef>
1590<typedef name="node_algorithms"><type>implementation_defined</type></typedef>
1591<typedef name="insert_commit_data"><type>node_algorithms::insert_commit_data</type></typedef>
1592<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
1593<data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
1594<method-group name="public member functions">
1595<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1596<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1597<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1598<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1599<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1600<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1601<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1602<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1603<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1604<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1605<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1606<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1607<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1608<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1609<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1610<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
1611<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
1612<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1613<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1614<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>bstree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
1615<method name="clone_from"><type>void</type><template>
1616          <template-type-parameter name="Cloner"/>
1617          <template-type-parameter name="Disposer"/>
1618        </template><parameter name="src"><paramtype>const <classname>bstree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
1619<method name="clone_from"><type>void</type><template>
1620          <template-type-parameter name="Cloner"/>
1621          <template-type-parameter name="Disposer"/>
1622        </template><parameter name="src"><paramtype><classname>bstree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
1623<method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1624<method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1625<method name="insert_equal"><type>void</type><template>
1626          <template-type-parameter name="Iterator"/>
1627        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1628<method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1629<method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1630<method name="insert_unique"><type>void</type><template>
1631          <template-type-parameter name="Iterator"/>
1632        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
1633<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
1634<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
1635<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
1636          <template-type-parameter name="KeyType"/>
1637          <template-type-parameter name="KeyTypeKeyCompare"/>
1638        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
1639<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
1640          <template-type-parameter name="KeyType"/>
1641          <template-type-parameter name="KeyTypeKeyCompare"/>
1642        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
1643<method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
1644<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
1645<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
1646<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
1647<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1648<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1649<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1650<method name="erase"><type>size_type</type><template>
1651          <template-type-parameter name="KeyType"/>
1652          <template-type-parameter name="KeyTypeKeyCompare"/>
1653        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1654<method name="erase_and_dispose"><type>iterator</type><template>
1655          <template-type-parameter name="Disposer"/>
1656        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
1657<method name="erase_and_dispose"><type>size_type</type><template>
1658          <template-type-parameter name="Disposer"/>
1659        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1660<method name="erase_and_dispose"><type>iterator</type><template>
1661          <template-type-parameter name="Disposer"/>
1662        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
1663<method name="erase_and_dispose"><type>size_type</type><template>
1664          <template-type-parameter name="KeyType"/>
1665          <template-type-parameter name="KeyTypeKeyCompare"/>
1666          <template-type-parameter name="Disposer"/>
1667        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
1668<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
1669<method name="clear_and_dispose"><type>void</type><template>
1670          <template-type-parameter name="Disposer"/>
1671        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
1672<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1673<method name="count" cv="const"><type>size_type</type><template>
1674          <template-type-parameter name="KeyType"/>
1675          <template-type-parameter name="KeyTypeKeyCompare"/>
1676        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1677<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1678<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1679<method name="lower_bound"><type>iterator</type><template>
1680          <template-type-parameter name="KeyType"/>
1681          <template-type-parameter name="KeyTypeKeyCompare"/>
1682        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1683<method name="lower_bound" cv="const"><type>const_iterator</type><template>
1684          <template-type-parameter name="KeyType"/>
1685          <template-type-parameter name="KeyTypeKeyCompare"/>
1686        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1687<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1688<method name="upper_bound"><type>iterator</type><template>
1689          <template-type-parameter name="KeyType"/>
1690          <template-type-parameter name="KeyTypeKeyCompare"/>
1691        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1692<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1693<method name="upper_bound" cv="const"><type>const_iterator</type><template>
1694          <template-type-parameter name="KeyType"/>
1695          <template-type-parameter name="KeyTypeKeyCompare"/>
1696        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1697<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1698<method name="find"><type>iterator</type><template>
1699          <template-type-parameter name="KeyType"/>
1700          <template-type-parameter name="KeyTypeKeyCompare"/>
1701        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1702<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1703<method name="find" cv="const"><type>const_iterator</type><template>
1704          <template-type-parameter name="KeyType"/>
1705          <template-type-parameter name="KeyTypeKeyCompare"/>
1706        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1707<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1708<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
1709          <template-type-parameter name="KeyType"/>
1710          <template-type-parameter name="KeyTypeKeyCompare"/>
1711        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1712<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
1713<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
1714          <template-type-parameter name="KeyType"/>
1715          <template-type-parameter name="KeyTypeKeyCompare"/>
1716        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
1717<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_value"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1718<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
1719          <template-type-parameter name="KeyType"/>
1720          <template-type-parameter name="KeyTypeKeyCompare"/>
1721        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1722<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1723<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
1724          <template-type-parameter name="KeyType"/>
1725          <template-type-parameter name="KeyTypeKeyCompare"/>
1726        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
1727<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1728<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1729<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
1730<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
1731<method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
1732<method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
1733<method name="merge_unique"><type>void</type><template>
1734          <template-type-parameter name="T"/>
1735          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
1736        </template><parameter name=""><paramtype><classname>bstree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
1737<method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
1738<method name="merge_equal"><type>void</type><template>
1739          <template-type-parameter name="T"/>
1740          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
1741        </template><parameter name=""><paramtype><classname>bstree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
1742<method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
1743<method name="check" cv="const"><type>void</type><template>
1744          <template-type-parameter name="ExtraChecker"/>
1745        </template><parameter name="extra_checker"><paramtype>ExtraChecker</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container with additional checks provided by the user.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
1746<method name="check" cv="const"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
1747</method-group>
1748<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
1749<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
1750<constructor><template>
1751          <template-type-parameter name="Iterator"/>
1752        </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
1753<constructor><parameter name="x"><paramtype><classname>bstree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
1754<copy-assignment><type><classname>bstree</classname> &amp;</type><parameter name="x"><paramtype><classname>bstree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
1755<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
1756<method-group name="public static functions">
1757<method name="container_from_end_iterator" specifiers="static"><type><classname>bstree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
1758<method name="container_from_end_iterator" specifiers="static"><type>const <classname>bstree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end const_iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
1759<method name="container_from_iterator" specifiers="static"><type><classname>bstree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
1760<method name="container_from_iterator" specifiers="static"><type>const <classname>bstree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid end const_iterator of container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
1761<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
1762<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
1763<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
1764<method name="remove_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
1765</method-group>
1766</class><struct name="make_bstree"><template>
1767      <template-type-parameter name="T"/>
1768      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
1769    </template><description><para>Helper metafunction to define a <computeroutput>bstree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
1770</struct>
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822</namespace>
1823</namespace>
1824</header>
1825<header name="boost/intrusive/bstree_algorithms.hpp">
1826<namespace name="boost">
1827<namespace name="intrusive">
1828<class name="bstree_algorithms"><template>
1829      <template-type-parameter name="NodeTraits"/>
1830    </template><inherit access="public">bstree_algorithms_base&lt; NodeTraits &gt;</inherit><description><para>This is an implementation of a binary search tree. A node in the search tree has references to its children and its parent. This is to allow traversal of the whole tree from a given node making the implementation of iterator a pointer to a node. At the top of the tree a node is used specially. This node's parent pointer is pointing to the root of the tree. Its left pointer points to the leftmost node in the tree and the right pointer to the rightmost one. This node is used to represent the end-iterator.                                      +---------+
1831header------------------------------&gt;|         |
1832                                     |         |
1833            +----------(left)--------|         |--------(right)---------+
1834            |                        +---------+                        |
1835            |                             |                             |
1836            |                             | (parent)                    |
1837            |                             |                             |
1838            |                             |                             |
1839            |                        +---------+                        |
1840 root of tree ..|......................&gt; | | | | | D | | | | | | | +----<mdash/>+------<mdash/>+----<mdash/>+ | <informaltable><tgroup cols="3"><tbody><row>
1841<entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry></row>
1842<row>
1843<entry/><entry/><entry/></row>
1844<row>
1845<entry/><entry/><entry/></row>
1846<row>
1847<entry/><entry/><entry/></row>
1848</tbody></tgroup></informaltable>
1849| +------<mdash/>+ +------<mdash/>+ | | | | | | | | | B | | F | | | | | | | | | +–+------<mdash/>+–+ +–+------<mdash/>+–+ | <informaltable><tgroup cols="5"><tbody><row>
1850<entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry></row>
1851<row>
1852<entry/><entry/><entry/><entry/><entry/></row>
1853</tbody></tgroup></informaltable>
1854| +<mdash/>+--<mdash/>+ +--<mdash/>+<mdash/>+ +<mdash/>+--<mdash/>+ +--<mdash/>+<mdash/>+ | +--&gt;| | | | | | | |&lt;–+ | A | | C | | E | | G | | | | | | | | | +------<mdash/>+ +------<mdash/>+ +------<mdash/>+ +------<mdash/>+</para><para><classname alt="boost::intrusive::bstree_algorithms">bstree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
1855<typedef name="node_traits"><type>NodeTraits</type></typedef>
1856<typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
1857<typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
1858<typedef name="insert_commit_data"><type>insert_commit_data_t&lt; node_ptr &gt;</type></typedef>
1859<typedef name="data_for_rebalance"><type>data_for_rebalance_t&lt; node_ptr &gt;</type></typedef>
1860<method-group name="public static functions">
1861<method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1862<method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1863<method name="root_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the root of the tree if any, header otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1864<method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1865<method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1866<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
1867<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
1868<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
1869<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
1870<method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1871<method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1872<method name="minimum" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of a tree but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the minimum node of the subtree starting at p.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the size of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1873<method name="maximum" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of a tree but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the maximum node of the subtree starting at p.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the size of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1874<method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
1875<method name="inited" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns true if node is in the same state as if called init(node)</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1876<method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
1877<method name="clear_and_dispose" specifiers="static"><type>void</type><template>
1878          <template-type-parameter name="Disposer"/>
1879        </template><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
1880<method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
1881<method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1882<method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1883<method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1884<method name="find" specifiers="static"><type>node_ptr</type><template>
1885          <template-type-parameter name="KeyType"/>
1886          <template-type-parameter name="KeyNodePtrCompare"/>
1887        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
1888<method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
1889          <template-type-parameter name="KeyType"/>
1890          <template-type-parameter name="KeyNodePtrCompare"/>
1891        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
1892<method name="count" specifiers="static"><type>std::size_t</type><template>
1893          <template-type-parameter name="KeyType"/>
1894          <template-type-parameter name="KeyNodePtrCompare"/>
1895        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
1896<method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
1897          <template-type-parameter name="KeyType"/>
1898          <template-type-parameter name="KeyNodePtrCompare"/>
1899        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
1900<method name="lower_bound_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
1901          <template-type-parameter name="KeyType"/>
1902          <template-type-parameter name="KeyNodePtrCompare"/>
1903        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing the first element that is equivalent to "key" according to "comp" or an empty range that indicates the position where that element would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
1904<method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
1905          <template-type-parameter name="KeyType"/>
1906          <template-type-parameter name="KeyNodePtrCompare"/>
1907        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
1908<method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
1909          <template-type-parameter name="KeyType"/>
1910          <template-type-parameter name="KeyNodePtrCompare"/>
1911        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
1912<method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
1913<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
1914          <template-type-parameter name="KeyType"/>
1915          <template-type-parameter name="KeyNodePtrCompare"/>
1916        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
1917<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
1918          <template-type-parameter name="KeyType"/>
1919          <template-type-parameter name="KeyNodePtrCompare"/>
1920        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="hint"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
1921<method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
1922          <template-type-parameter name="NodePtrCompare"/>
1923        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
1924<method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
1925          <template-type-parameter name="NodePtrCompare"/>
1926        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
1927<method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
1928          <template-type-parameter name="NodePtrCompare"/>
1929        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
1930<method name="insert_before" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
1931<method name="push_back" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
1932<method name="push_front" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
1933<method name="depth" specifiers="static"><type>std::size_t</type><parameter name="node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' can't be a header node.</para><para><emphasis role="bold">Effects</emphasis>: Calculates the depth of a node: the depth of a node is the length (number of edges) of the path from the root to that node. (The root node is at depth 0.)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of nodes in the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1934<method name="clone" specifiers="static"><type>void</type><template>
1935          <template-type-parameter name="Cloner"/>
1936          <template-type-parameter name="Disposer"/>
1937        </template><parameter name="source_header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
1938<method name="erase" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1939<method name="transfer_unique" specifiers="static"><type>bool</type><template>
1940          <template-type-parameter name="NodePtrCompare"/>
1941        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
1942<method name="transfer_equal" specifiers="static"><type>void</type><template>
1943          <template-type-parameter name="NodePtrCompare"/>
1944        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
1945<method name="unlink" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1946<method name="rebalance" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
1947<method name="rebalance_subtree" specifiers="static"><type>node_ptr</type><parameter name="old_root"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree. It shall not be null.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
1948<method name="check" specifiers="static"><type>void</type><template>
1949          <template-type-parameter name="Checker"/>
1950        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="checker"><paramtype>Checker</paramtype></parameter><parameter name="checker_return"><paramtype>typename Checker::return_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container with additional checks provided by the user.</para><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
1951</method-group>
1952<method-group name="protected static functions">
1953<method name="transfer_unique" specifiers="static"><type>bool</type><template>
1954          <template-type-parameter name="NodePtrCompare"/>
1955        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="info"><paramtype>data_for_rebalance &amp;</paramtype></parameter></method>
1956<method name="transfer_equal" specifiers="static"><type>void</type><template>
1957          <template-type-parameter name="NodePtrCompare"/>
1958        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="info"><paramtype>data_for_rebalance &amp;</paramtype></parameter></method>
1959<method name="erase" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="info"><paramtype>data_for_rebalance &amp;</paramtype></parameter></method>
1960<method name="subtree_size" specifiers="static"><type>std::size_t</type><parameter name="subtree"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1961<method name="is_left_child" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is a left child.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1962<method name="is_right_child" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is a right child.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1963<method name="insert_before_check" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
1964<method name="push_back_check" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
1965<method name="push_front_check" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
1966<method name="insert_equal_check" specifiers="static"><type>void</type><template>
1967          <template-type-parameter name="NodePtrCompare"/>
1968        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
1969<method name="insert_equal_upper_bound_check" specifiers="static"><type>void</type><template>
1970          <template-type-parameter name="NodePtrCompare"/>
1971        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><parameter name="pdepth"><paramtype>std::size_t *</paramtype><default>0</default></parameter></method>
1972<method name="insert_equal_lower_bound_check" specifiers="static"><type>void</type><template>
1973          <template-type-parameter name="NodePtrCompare"/>
1974        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><parameter name="pdepth"><paramtype>std::size_t *</paramtype><default>0</default></parameter></method>
1975<method name="insert_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter></method>
1976<method name="set_child" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_child"><paramtype>node_ptr</paramtype></parameter><parameter name="new_parent"><paramtype>node_ptr</paramtype></parameter><parameter name="link_left"><paramtype>const bool</paramtype></parameter></method>
1977<method name="rotate_left_no_parent_fix" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="p_right"><paramtype>node_ptr</paramtype></parameter></method>
1978<method name="rotate_left" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="p_right"><paramtype>node_ptr</paramtype></parameter><parameter name="p_parent"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter></method>
1979<method name="rotate_right_no_parent_fix" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="p_left"><paramtype>node_ptr</paramtype></parameter></method>
1980<method name="rotate_right" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="p_left"><paramtype>node_ptr</paramtype></parameter><parameter name="p_parent"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter></method>
1981</method-group>
1982<method-group name="private static functions">
1983<method name="subtree_to_vine" specifiers="static"><type>void</type><parameter name="vine_tail"><paramtype>node_ptr</paramtype></parameter><parameter name="size"><paramtype>std::size_t &amp;</paramtype></parameter></method>
1984<method name="compress_subtree" specifiers="static"><type>void</type><parameter name="scanner"><paramtype>node_ptr</paramtype></parameter><parameter name="count"><paramtype>std::size_t</paramtype></parameter></method>
1985<method name="vine_to_subtree" specifiers="static"><type>void</type><parameter name="super_root"><paramtype>node_ptr</paramtype></parameter><parameter name="count"><paramtype>std::size_t</paramtype></parameter></method>
1986<method name="get_root" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "n" must be a node inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns a pointer to the header node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
1987<method name="clone_subtree" specifiers="static"><type>node_ptr</type><template>
1988          <template-type-parameter name="Cloner"/>
1989          <template-type-parameter name="Disposer"/>
1990        </template><parameter name="source_parent"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="target_parent"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><parameter name="leftmost_out"><paramtype>node_ptr &amp;</paramtype></parameter><parameter name="rightmost_out"><paramtype>node_ptr &amp;</paramtype></parameter></method>
1991<method name="dispose_subtree" specifiers="static"><type>void</type><template>
1992          <template-type-parameter name="Disposer"/>
1993        </template><parameter name="x"><paramtype>node_ptr</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter></method>
1994<method name="lower_bound_loop" specifiers="static"><type>node_ptr</type><template>
1995          <template-type-parameter name="KeyType"/>
1996          <template-type-parameter name="KeyNodePtrCompare"/>
1997        </template><parameter name="x"><paramtype>node_ptr</paramtype></parameter><parameter name="y"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter></method>
1998<method name="upper_bound_loop" specifiers="static"><type>node_ptr</type><template>
1999          <template-type-parameter name="KeyType"/>
2000          <template-type-parameter name="KeyNodePtrCompare"/>
2001        </template><parameter name="x"><paramtype>node_ptr</paramtype></parameter><parameter name="y"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter></method>
2002<method name="check_subtree" specifiers="static"><type>void</type><template>
2003          <template-type-parameter name="Checker"/>
2004        </template><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="checker"><paramtype>Checker</paramtype></parameter><parameter name="check_return"><paramtype>typename Checker::return_type &amp;</paramtype></parameter></method>
2005</method-group>
2006</class>
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058</namespace>
2059</namespace>
2060</header>
2061<header name="boost/intrusive/circular_list_algorithms.hpp">
2062<namespace name="boost">
2063<namespace name="intrusive">
2064<class name="circular_list_algorithms"><template>
2065      <template-type-parameter name="NodeTraits"/>
2066    </template><description><para><classname alt="boost::intrusive::circular_list_algorithms">circular_list_algorithms</classname> provides basic algorithms to manipulate nodes forming a circular doubly linked list. An empty circular list is formed by a node whose pointers point to itself.</para><para><classname alt="boost::intrusive::circular_list_algorithms">circular_list_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the circular list</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_previous(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_previous(node_ptr n, node_ptr prev);</computeroutput></para><para><computeroutput>static node_ptr get_next(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_next(node_ptr n, node_ptr next);</computeroutput> </para></description><struct name="stable_partition_info"><data-member name="num_1st_partition"><type>std::size_t</type></data-member>
2067<data-member name="num_2nd_partition"><type>std::size_t</type></data-member>
2068<data-member name="beg_2st_partition"><type>node_ptr</type></data-member>
2069</struct><typedef name="node"><type>NodeTraits::node</type></typedef>
2070<typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
2071<typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
2072<typedef name="node_traits"><type>NodeTraits</type></typedef>
2073<method-group name="public static functions">
2074<method name="init" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an non-used list element, so that inited(this_node) == true</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2075<method name="inited" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" is in a non-used state as if it was initialized by the "init" function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2076<method name="init_header" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty list, making this_node the only node of the circular list: <computeroutput>NodeTraits::get_next(this_node) == NodeTraits::get_previous(this_node) == this_node</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2077<method name="unique" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" is the only node of a circular list: <computeroutput>return NodeTraits::get_next(this_node) == this_node</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2078<method name="count" specifiers="static"><type>std::size_t</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes in a circular list. If the circular list is empty, returns 1.</para><para><emphasis role="bold">Complexity</emphasis>: Linear</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2079<method name="unlink" specifiers="static"><type>node_ptr</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2080<method name="unlink" specifiers="static"><type>void</type><parameter name="b"><paramtype>node_ptr</paramtype></parameter><parameter name="e"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be nodes of the same circular list or an empty range.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node [b, e) from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2081<method name="link_before" specifiers="static"><type>void</type><parameter name="nxt_node"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: nxt_node must be a node of a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node before nxt_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2082<method name="link_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be a node of a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node after prev_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2083<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and other_node must be nodes inserted in circular lists or be empty circular lists.</para><para><emphasis role="bold">Effects</emphasis>: Swaps the position of the nodes: this_node is inserted in other_nodes position in the second circular list and the other_node is inserted in this_node's position in the first circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2084<method name="transfer" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="b"><paramtype>node_ptr</paramtype></parameter><parameter name="e"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be nodes of the same circular list or an empty range. and p must be a node of a different circular list or may not be an iterator in <emphasis role="bold">Effects</emphasis>: Removes the nodes from [b, e) range from their circular list and inserts them before p in p's circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2085<method name="transfer" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="i"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: i must a node of a circular list and p must be a node of a different circular list.</para><para><emphasis role="bold">Effects</emphasis>: Removes the node i from its circular list and inserts it before p in p's circular list. If p == i or p == NodeTraits::get_next(i), this function is a null operation.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2086<method name="reverse" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time. </para></description></method>
2087<method name="move_backwards" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the node p n positions towards the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of moved positions. </para></description></method>
2088<method name="move_forward" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the node p n positions towards the beginning of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of moved positions. </para></description></method>
2089<method name="distance" specifiers="static"><type>std::size_t</type><parameter name="f"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="l"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: f and l must be in a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes in the range [f, l).</para><para><emphasis role="bold">Complexity</emphasis>: Linear</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2090<method name="stable_partition" specifiers="static"><type>void</type><template>
2091          <template-type-parameter name="Pred"/>
2092        </template><parameter name="beg"><paramtype>node_ptr</paramtype></parameter><parameter name="end"><paramtype>node_ptr</paramtype></parameter><parameter name="pred"><paramtype>Pred</paramtype></parameter><parameter name="info"><paramtype>stable_partition_info &amp;</paramtype></parameter></method>
2093</method-group>
2094<method-group name="private static functions">
2095<method name="swap_prev" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter></method>
2096<method name="swap_next" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter></method>
2097</method-group>
2098</class>
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150</namespace>
2151</namespace>
2152</header>
2153<header name="boost/intrusive/circular_slist_algorithms.hpp">
2154<namespace name="boost">
2155<namespace name="intrusive">
2156<class name="circular_slist_algorithms"><template>
2157      <template-type-parameter name="NodeTraits"/>
2158    </template><description><para><classname alt="boost::intrusive::circular_slist_algorithms">circular_slist_algorithms</classname> provides basic algorithms to manipulate nodes forming a circular singly linked list. An empty circular list is formed by a node whose pointer to the next node points to itself.</para><para><classname alt="boost::intrusive::circular_slist_algorithms">circular_slist_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the circular list</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_next(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_next(node_ptr n, node_ptr next);</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
2159<typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
2160<typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
2161<typedef name="node_traits"><type>NodeTraits</type></typedef>
2162<method-group name="public static functions">
2163<method name="init" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an non-used list element, putting the next pointer to null: <computeroutput>NodeTraits::get_next(this_node) == node_ptr()</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2164<method name="unique" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" is the only node of a circular list: or it's a not inserted node: <computeroutput>return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2165<method name="inited" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" has the same state as if it was inited using "init(node_ptr)"</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2166<method name="unlink_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the next node of prev_node from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2167<method name="unlink_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>node_ptr</paramtype></parameter><parameter name="last_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node and last_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the range (prev_node, last_node) from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2168<method name="link_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be a node of a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node after prev_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2169<method name="transfer_after" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="b"><paramtype>node_ptr</paramtype></parameter><parameter name="e"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be nodes of the same circular list or an empty range. and p must be a node of a different circular list.</para><para><emphasis role="bold">Effects</emphasis>: Removes the nodes from (b, e] range from their circular list and inserts them after p in p's circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2170<method name="init_header" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty list, making this_node the only node of the circular list: <computeroutput>NodeTraits::get_next(this_node) == this_node</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2171<method name="get_previous_node" specifiers="static"><type>node_ptr</type><parameter name="prev_init_node"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and prev_init_node must be in the same circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of this_node in the circular list starting. the search from prev_init_node. The first node checked for equality is NodeTraits::get_next(prev_init_node).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements between prev_init_node and this_node.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2172<method name="get_previous_node" specifiers="static"><type>node_ptr</type><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of this_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2173<method name="get_previous_previous_node" specifiers="static"><type>node_ptr</type><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the previous node of this_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2174<method name="get_previous_previous_node" specifiers="static"><type>node_ptr</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and p must be in the same circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the previous node of this_node in the circular list starting. the search from p. The first node checked for equality is NodeTraits::get_next((NodeTraits::get_next(p)).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2175<method name="count" specifiers="static"><type>std::size_t</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes in a circular list. If the circular list is empty, returns 1.</para><para><emphasis role="bold">Complexity</emphasis>: Linear</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2176<method name="unlink" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list, be an empty circular list or be inited.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2177<method name="link_before" specifiers="static"><type>void</type><parameter name="nxt_node"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: nxt_node must be a node of a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node before nxt_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2178<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and other_node must be nodes inserted in circular lists or be empty circular lists.</para><para><emphasis role="bold">Effects</emphasis>: Swaps the position of the nodes: this_node is inserted in other_nodes position in the second circular list and the other_node is inserted in this_node's position in the first circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to number of elements of both lists</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2179<method name="reverse" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear to the contained elements. </para></description></method>
2180<method name="move_backwards" specifiers="static"><type>node_ptr</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the node p n positions towards the end of the list.</para><para><emphasis role="bold">Returns</emphasis>: The previous node of p after the function if there has been any movement, Null if n leads to no movement.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number moved positions. </para></description></method>
2181<method name="move_forward" specifiers="static"><type>node_ptr</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the node p n positions towards the beginning of the list.</para><para><emphasis role="bold">Returns</emphasis>: The previous node of p after the function if there has been any movement, Null if n leads equals to no movement.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number moved positions. </para></description></method>
2182</method-group>
2183</class>
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235</namespace>
2236</namespace>
2237</header>
2238<header name="boost/intrusive/derivation_value_traits.hpp">
2239<namespace name="boost">
2240<namespace name="intrusive">
2241<struct name="derivation_value_traits"><template>
2242      <template-type-parameter name="T"/>
2243      <template-type-parameter name="NodeTraits"/>
2244      <template-nontype-parameter name="LinkMode"><type>link_mode_type</type><default>safe_link</default></template-nontype-parameter>
2245    </template><description><para>This value traits template is used to create value traits from user defined node traits where value_traits::value_type will derive from node_traits::node </para></description><typedef name="node_traits"><type>NodeTraits</type></typedef>
2246<typedef name="value_type"><type>T</type></typedef>
2247<typedef name="node"><type>node_traits::node</type></typedef>
2248<typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
2249<typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
2250<typedef name="pointer"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::template rebind_pointer&lt; value_type &gt;::type</type></typedef>
2251<typedef name="const_pointer"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::template rebind_pointer&lt; const value_type &gt;::type</type></typedef>
2252<typedef name="reference"><type><classname>boost::intrusive::pointer_traits</classname>&lt; pointer &gt;::reference</type></typedef>
2253<typedef name="const_reference"><type><classname>boost::intrusive::pointer_traits</classname>&lt; const_pointer &gt;::reference</type></typedef>
2254<data-member name="link_mode" specifiers="static"><type>const link_mode_type</type></data-member>
2255<method-group name="public static functions">
2256<method name="to_node_ptr" specifiers="static"><type>node_ptr</type><parameter name="value"><paramtype>reference</paramtype></parameter></method>
2257<method name="to_node_ptr" specifiers="static"><type>const_node_ptr</type><parameter name="value"><paramtype>const_reference</paramtype></parameter></method>
2258<method name="to_value_ptr" specifiers="static"><type>pointer</type><parameter name="n"><paramtype>const node_ptr &amp;</paramtype></parameter></method>
2259<method name="to_value_ptr" specifiers="static"><type>const_pointer</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter></method>
2260</method-group>
2261</struct>
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313</namespace>
2314</namespace>
2315</header>
2316<header name="boost/intrusive/hashtable.hpp">
2317<namespace name="boost">
2318<namespace name="intrusive">
2319<class name="hashtable"><template>
2320      <template-type-parameter name="T"/>
2321      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
2322    </template><inherit access="private">hashtable_size_traits_wrapper&lt; hashdata_internal&lt; ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags &amp;(hash_bool_flags::incremental_pos|hash_bool_flags::cache_begin_pos) &gt;, SizeType,(BoolFlags &amp;hash_bool_flags::constant_time_size_pos) !=0 &gt;</inherit><description><para>The class template hashtable is an intrusive hash table container, that is used to construct intrusive <classname alt="boost::intrusive::unordered_set">unordered_set</classname> and <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> containers. The no-throw guarantee holds only, if the VoidOrKeyEqual object and Hasher don't throw.</para><para>hashtable is a semi-intrusive container: each object to be stored in the container must contain a proper hook, but the container also needs additional auxiliary memory to work: hashtable needs a pointer to an array of type <computeroutput>bucket_type</computeroutput> to be passed in the constructor. This bucket array must have at least the same lifetime as the container. This makes the use of hashtable more complicated than purely intrusive containers. <computeroutput>bucket_type</computeroutput> is default-constructible, copyable and assignable</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>hash&lt;&gt;</computeroutput> and <computeroutput>equal&lt;&gt;</computeroutput> <computeroutput>bucket_traits&lt;&gt;</computeroutput>, power_2_buckets&lt;&gt;, cache_begin&lt;&gt; and incremental&lt;&gt;.</para><para>hashtable only provides forward iterators but it provides 4 iterator types: iterator and const_iterator to navigate through the whole container and local_iterator and const_local_iterator to navigate through the values stored in a single bucket. Local iterators are faster and smaller.</para><para>It's not recommended to use non constant-time size hashtables because several key functions, like "empty()", become non-constant time functions. Non constant_time size hashtables are mainly provided to support auto-unlink hooks.</para><para>hashtables, does not make automatic rehashings nor offers functions related to a load factor. Rehashing can be explicitly requested and the user must provide a new bucket array that will be used from that moment.</para><para>Since no automatic rehashing is done, iterators are never invalidated when inserting or erasing elements. Iterators are only invalidated when rehashing. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
2323<typedef name="pointer"><type>value_traits::pointer</type></typedef>
2324<typedef name="const_pointer"><type>value_traits::const_pointer</type></typedef>
2325<typedef name="value_type"><type>value_traits::value_type</type></typedef>
2326<typedef name="key_type"><type>hash_types_base::key_type</type></typedef>
2327<typedef name="key_of_value"><type>hash_types_base::key_of_value</type></typedef>
2328<typedef name="reference"><type><classname>pointer_traits</classname>&lt; pointer &gt;::reference</type></typedef>
2329<typedef name="const_reference"><type><classname>pointer_traits</classname>&lt; const_pointer &gt;::reference</type></typedef>
2330<typedef name="difference_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::difference_type</type></typedef>
2331<typedef name="size_type"><type>SizeType</type></typedef>
2332<typedef name="key_equal"><type>internal_type::key_equal</type></typedef>
2333<typedef name="hasher"><type>internal_type::hasher</type></typedef>
2334<typedef name="bucket_type"><type>bucket_impl&lt; <classname>slist</classname> &gt;</type></typedef>
2335<typedef name="bucket_ptr"><type>internal_type::bucket_ptr</type></typedef>
2336<typedef name="siterator"><type>slist::iterator</type></typedef>
2337<typedef name="const_siterator"><type>slist::const_iterator</type></typedef>
2338<typedef name="iterator"><type>internal_type::iterator</type></typedef>
2339<typedef name="const_iterator"><type>internal_type::const_iterator</type></typedef>
2340<typedef name="local_iterator"><type>internal_type::local_iterator</type></typedef>
2341<typedef name="const_local_iterator"><type>internal_type::const_local_iterator</type></typedef>
2342<typedef name="node_traits"><type>value_traits::node_traits</type></typedef>
2343<typedef name="node"><type>node_traits::node</type></typedef>
2344<typedef name="node_ptr"><type><classname>pointer_traits</classname>&lt; pointer &gt;::template rebind_pointer&lt; node &gt;::type</type></typedef>
2345<typedef name="const_node_ptr"><type><classname>pointer_traits</classname>&lt; pointer &gt;::template rebind_pointer&lt; const node &gt;::type</type></typedef>
2346<typedef name="node_reference"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::reference</type></typedef>
2347<typedef name="const_node_reference"><type><classname>pointer_traits</classname>&lt; const_node_ptr &gt;::reference</type></typedef>
2348<typedef name="node_algorithms"><type>slist::node_algorithms</type></typedef>
2349<typedef name="insert_commit_data"><type><emphasis>unspecified</emphasis></type></typedef>
2350<data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
2351<data-member name="store_hash" specifiers="static"><type>const bool</type></data-member>
2352<data-member name="unique_keys" specifiers="static"><type>const bool</type></data-member>
2353<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
2354<data-member name="cache_begin" specifiers="static"><type>const bool</type></data-member>
2355<data-member name="compare_hash" specifiers="static"><type>const bool</type></data-member>
2356<data-member name="incremental" specifiers="static"><type>const bool</type></data-member>
2357<data-member name="power_2_buckets" specifiers="static"><type>const bool</type></data-member>
2358<data-member name="optimize_multikey" specifiers="static"><type>const bool</type></data-member>
2359<method-group name="public member functions">
2360<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2361<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2362<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2363<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2364<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2365<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2366<method name="hash_function" cv="const"><type>hasher</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the hasher object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hasher copy-constructor throws. </para></description></method>
2367<method name="key_eq" cv="const"><type>key_equal</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_equal object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_equal copy-constructor throws. </para></description></method>
2368<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: if constant-time size and <classname alt="boost::intrusive::cache_begin">cache_begin</classname> options are disabled, average constant time (worst case, with empty() == true: O(this-&gt;bucket_count()). Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2369<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is false. Constant-time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2370<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>hashtable</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: the hasher and the equality function unqualified swap call should not throw.</para><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two unordered_sets. Swaps also the contained bucket array and equality and hasher functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the swap() call for the comparison or hash functors found using ADL throw. Basic guarantee. </para></description></method>
2371<method name="clone_from"><type>void</type><template>
2372          <template-type-parameter name="Cloner"/>
2373          <template-type-parameter name="Disposer"/>
2374        </template><parameter name="src"><paramtype>const <classname>hashtable</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
2375<method name="clone_from"><type>void</type><template>
2376          <template-type-parameter name="Cloner"/>
2377          <template-type-parameter name="Disposer"/>
2378        </template><parameter name="src"><paramtype><classname>hashtable</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
2379<method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value into the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the inserted value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
2380<method name="insert_equal"><type>void</type><template>
2381          <template-type-parameter name="Iterator"/>
2382        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Equivalent to this-&gt;insert_equal(t) for each element in [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(N), where N is distance(b, e). Worst case O(N*this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
2383<method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Tries to inserts value into the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Returns</emphasis>: If the value is not already present inserts it and returns a pair containing the iterator to the new value and true. If there is an equivalent value returns a pair containing an iterator to the already present value and false.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
2384<method name="insert_unique"><type>void</type><template>
2385          <template-type-parameter name="Iterator"/>
2386        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Equivalent to this-&gt;insert_unique(t) for each element in [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(N), where N is distance(b, e). Worst case O(N*this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
2387<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
2388          <template-type-parameter name="KeyType"/>
2389          <template-type-parameter name="KeyHasher"/>
2390          <template-type-parameter name="KeyEqual"/>
2391        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the hash or the equality is much cheaper to construct than the value_type and this function offers the possibility to use that the part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time.</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
2392<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hasher or key_compare throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the hash or the equality is much cheaper to construct than the value_type and this function offers the possibility to use that the part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time.</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
2393<method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
2394<method name="erase"><type>void</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. No destructors are called. </para></description></method>
2395<method name="erase"><type>void</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
2396<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
2397<method name="erase"><type>size_type</type><template>
2398          <template-type-parameter name="KeyType"/>
2399          <template-type-parameter name="KeyHasher"/>
2400          <template-type-parameter name="KeyEqual"/>
2401        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements that have the same hash and compare equal with the given key.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
2402<method name="erase_and_dispose"><type>void</type><template>
2403          <template-type-parameter name="Disposer"/>
2404        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
2405<method name="erase_and_dispose"><type>void</type><template>
2406          <template-type-parameter name="Disposer"/>
2407        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
2408<method name="erase_and_dispose"><type>size_type</type><template>
2409          <template-type-parameter name="Disposer"/>
2410        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
2411<method name="erase_and_dispose"><type>size_type</type><template>
2412          <template-type-parameter name="KeyType"/>
2413          <template-type-parameter name="KeyHasher"/>
2414          <template-type-parameter name="KeyEqual"/>
2415          <template-type-parameter name="Disposer"/>
2416        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "equal_func". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
2417<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
2418<method name="clear_and_dispose"><type>void</type><template>
2419          <template-type-parameter name="Disposer"/>
2420        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
2421<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
2422<method name="count" cv="const"><type>size_type</type><template>
2423          <template-type-parameter name="KeyType"/>
2424          <template-type-parameter name="KeyHasher"/>
2425          <template-type-parameter name="KeyEqual"/>
2426        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal throw. </para></description></method>
2427<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element is equal to "value" or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
2428<method name="find"><type>iterator</type><template>
2429          <template-type-parameter name="KeyType"/>
2430          <template-type-parameter name="KeyHasher"/>
2431          <template-type-parameter name="KeyEqual"/>
2432        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hash and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
2433<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a const_iterator to the first element whose key is "key" or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
2434<method name="find" cv="const"><type>const_iterator</type><template>
2435          <template-type-parameter name="KeyType"/>
2436          <template-type-parameter name="KeyHasher"/>
2437          <template-type-parameter name="KeyEqual"/>
2438        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hasher and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
2439<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
2440<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
2441          <template-type-parameter name="KeyType"/>
2442          <template-type-parameter name="KeyHasher"/>
2443          <template-type-parameter name="KeyEqual"/>
2444        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or the equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
2445<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
2446<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
2447          <template-type-parameter name="KeyType"/>
2448          <template-type-parameter name="KeyHasher"/>
2449          <template-type-parameter name="KeyEqual"/>
2450        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the hasher or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
2451<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
2452<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
2453<method name="local_iterator_to"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2454<method name="local_iterator_to" cv="const"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2455<method name="bucket_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of buckets passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2456<method name="bucket_size" cv="const"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements in the nth bucket.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2457<method name="bucket" cv="const"><type>size_type</type><parameter name="k"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the hash functor throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
2458<method name="bucket" cv="const"><type>size_type</type><template>
2459          <template-type-parameter name="KeyType"/>
2460          <template-type-parameter name="KeyHasher"/>
2461        </template><parameter name="k"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hash_func throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
2462<method name="bucket_pointer" cv="const"><type>bucket_ptr</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the bucket array pointer passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2463<method name="begin"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
2464<method name="begin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
2465<method name="cbegin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
2466<method name="end"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
2467<method name="end" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
2468<method name="cend" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
2469<method name="rehash"><type>void</type><parameter name="new_bucket_traits"><paramtype>const <classname>bucket_traits</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_bucket_traits can hold a pointer to a new bucket array or the same as the old bucket array with a different length. new_size is the length of the the array pointed by new_buckets. If new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer() new_bucket_traits.bucket_count() can be bigger or smaller than this-&gt;bucket_count(). 'new_bucket_traits' copy constructor should not throw.</para><para><emphasis role="bold">Effects</emphasis>: If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is false, unlinks values from the old bucket and inserts then in the new one according to the hash value of values.</para><para>If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is true, the implementations avoids moving values as much as possible.</para><para>Bucket traits hold by *this is assigned from new_bucket_traits. If the container is configured as incremental&lt;&gt;, the split bucket is set to the new bucket_count().</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function. If false, the implementation tries to minimize calls to the hash function (e.g. once for equivalent values if optimize_multikey&lt;true&gt; is true).</para><para>If rehash is successful updates the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> with new_bucket_traits.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
2470<method name="full_rehash"><type>void</type><description><para><emphasis role="bold">Note</emphasis>: This function is used when keys from inserted elements are changed (e.g. a language change when key is a string) but uniqueness and hash properties are preserved so a fast full rehash recovers invariants for *this without extracting and reinserting all elements again.</para><para><emphasis role="bold">Requires</emphasis>: Calls produced to the hash function should not alter the value uniqueness properties of already inserted elements. If hasher(key1) == hasher(key2) was true when elements were inserted, it shall be true during calls produced in the execution of this function.</para><para>key_equal is not called inside this function so it is assumed that key_equal(value1, value2) should produce the same results as before for inserted elements.</para><para><emphasis role="bold">Effects</emphasis>: Reprocesses all values hold by *this, recalculating their hash values and redistributing them though the buckets.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method uses the hash function and updates the stored hash value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
2471<method name="incremental_rehash"><type>bool</type><parameter name="grow"><paramtype>bool</paramtype><default>true</default></parameter><description><para><emphasis role="bold">Requires</emphasis>:</para><para><emphasis role="bold">Effects</emphasis>:</para><para><emphasis role="bold">Complexity</emphasis>:</para><para><emphasis role="bold">Throws</emphasis>:</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description><description><para>grow </para></description></method>
2472<method name="incremental_rehash"><type>bool</type><parameter name="new_bucket_traits"><paramtype>const <classname>bucket_traits</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If new_bucket_traits.bucket_count() is not this-&gt;bucket_count()/2 or this-&gt;bucket_count()*2, or this-&gt;split_bucket() != new_bucket_traits.bucket_count() returns false and does nothing.</para><para>Otherwise, copy assigns new_bucket_traits to the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> and transfers all the objects from old buckets to the new ones.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to size().</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
2473<method name="split_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Requires</emphasis>: incremental&lt;&gt; option must be set</para><para><emphasis role="bold">Effects</emphasis>: returns the current split count</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing </para></description></method>
2474</method-group>
2475<constructor specifiers="explicit"><parameter name="b_traits"><paramtype>const <classname>bucket_traits</classname> &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
2476<constructor><template>
2477          <template-type-parameter name="Iterator"/>
2478        </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="b_traits"><paramtype>const <classname>bucket_traits</classname> &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource and dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: If N is distance(b, e): Average case is O(N) (with a good hash function and with buckets_len &gt;= N),worst case O(N^2).</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hasher or key_equal throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
2479<constructor><parameter name="x"><paramtype><classname>hashtable</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal value traits, bucket traits, hasher and comparison are move constructed and nodes belonging to x are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of value traits, bucket traits, hasher or comparison throws. </para></description></constructor>
2480<copy-assignment><type><classname>hashtable</classname> &amp;</type><parameter name="x"><paramtype><classname>hashtable</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap. </para></description></copy-assignment>
2481<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> are not deleted (i.e. no destructors are called).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, if it's a safe-mode or auto-unlink value. Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
2482<method-group name="public static functions">
2483<method name="s_local_iterator_to" specifiers="static"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
2484<method name="s_local_iterator_to" specifiers="static"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
2485<method name="suggested_upper_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is bigger or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the higher possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2486<method name="suggested_lower_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is smaller or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the lowest possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2487</method-group>
2488</class><struct name="make_hashtable"><template>
2489      <template-type-parameter name="T"/>
2490      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
2491    </template><description><para>Helper metafunction to define a <computeroutput>hashtable</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
2492</struct>
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544</namespace>
2545</namespace>
2546</header>
2547<header name="boost/intrusive/intrusive_fwd.hpp">
2548<para>This header file forward declares most Intrusive classes.</para><para>It forward declares the following containers and hooks:<itemizedlist>
2549<listitem><para><classname alt="boost::intrusive::slist">boost::intrusive::slist</classname> / <classname alt="boost::intrusive::slist_base_hook">boost::intrusive::slist_base_hook</classname> / <classname alt="boost::intrusive::slist_member_hook">boost::intrusive::slist_member_hook</classname></para>
2550</listitem><listitem><para><classname alt="boost::intrusive::list">boost::intrusive::list</classname> / <classname alt="boost::intrusive::list_base_hook">boost::intrusive::list_base_hook</classname> / <classname alt="boost::intrusive::list_member_hook">boost::intrusive::list_member_hook</classname></para>
2551</listitem><listitem><para><classname alt="boost::intrusive::bstree">boost::intrusive::bstree</classname> / <classname alt="boost::intrusive::bs_set">boost::intrusive::bs_set</classname> / <classname alt="boost::intrusive::bs_multiset">boost::intrusive::bs_multiset</classname> / <classname alt="boost::intrusive::bs_set_base_hook">boost::intrusive::bs_set_base_hook</classname> / <classname alt="boost::intrusive::bs_set_member_hook">boost::intrusive::bs_set_member_hook</classname></para>
2552</listitem><listitem><para><classname alt="boost::intrusive::rbtree">boost::intrusive::rbtree</classname> / <classname alt="boost::intrusive::set">boost::intrusive::set</classname> / <classname alt="boost::intrusive::multiset">boost::intrusive::multiset</classname> / <classname alt="boost::intrusive::set_base_hook">boost::intrusive::set_base_hook</classname> / <classname alt="boost::intrusive::set_member_hook">boost::intrusive::set_member_hook</classname></para>
2553</listitem><listitem><para><classname alt="boost::intrusive::avltree">boost::intrusive::avltree</classname> / <classname alt="boost::intrusive::avl_set">boost::intrusive::avl_set</classname> / <classname alt="boost::intrusive::avl_multiset">boost::intrusive::avl_multiset</classname> / <classname alt="boost::intrusive::avl_set_base_hook">boost::intrusive::avl_set_base_hook</classname> / <classname alt="boost::intrusive::avl_set_member_hook">boost::intrusive::avl_set_member_hook</classname></para>
2554</listitem><listitem><para><classname alt="boost::intrusive::splaytree">boost::intrusive::splaytree</classname> / <classname alt="boost::intrusive::splay_set">boost::intrusive::splay_set</classname> / <classname alt="boost::intrusive::splay_multiset">boost::intrusive::splay_multiset</classname></para>
2555</listitem><listitem><para><classname alt="boost::intrusive::sgtree">boost::intrusive::sgtree</classname> / <classname alt="boost::intrusive::sg_set">boost::intrusive::sg_set</classname> / <classname alt="boost::intrusive::sg_multiset">boost::intrusive::sg_multiset</classname></para>
2556</listitem><listitem><para><classname alt="boost::intrusive::treap">boost::intrusive::treap</classname> / <classname alt="boost::intrusive::treap_set">boost::intrusive::treap_set</classname> / <classname alt="boost::intrusive::treap_multiset">boost::intrusive::treap_multiset</classname></para>
2557</listitem><listitem><para><classname alt="boost::intrusive::hashtable">boost::intrusive::hashtable</classname> / <classname alt="boost::intrusive::unordered_set">boost::intrusive::unordered_set</classname> / <classname alt="boost::intrusive::unordered_multiset">boost::intrusive::unordered_multiset</classname> / <classname alt="boost::intrusive::unordered_set_base_hook">boost::intrusive::unordered_set_base_hook</classname> / <classname alt="boost::intrusive::unordered_set_member_hook">boost::intrusive::unordered_set_member_hook</classname> /</para>
2558</listitem><listitem><para><classname alt="boost::intrusive::any_base_hook">boost::intrusive::any_base_hook</classname> / <classname alt="boost::intrusive::any_member_hook">boost::intrusive::any_member_hook</classname></para>
2559</listitem></itemizedlist>
2560</para><para>It forward declares the following container or hook options:<itemizedlist>
2561<listitem><para><classname alt="boost::intrusive::constant_time_size">boost::intrusive::constant_time_size</classname> / <classname alt="boost::intrusive::size_type">boost::intrusive::size_type</classname> / <classname alt="boost::intrusive::compare">boost::intrusive::compare</classname> / <classname alt="boost::intrusive::equal">boost::intrusive::equal</classname></para>
2562</listitem><listitem><para><classname alt="boost::intrusive::floating_point">boost::intrusive::floating_point</classname> / <classname alt="boost::intrusive::priority">boost::intrusive::priority</classname> / <classname alt="boost::intrusive::hash">boost::intrusive::hash</classname></para>
2563</listitem><listitem><para><classname alt="boost::intrusive::value_traits">boost::intrusive::value_traits</classname> / <classname alt="boost::intrusive::member_hook">boost::intrusive::member_hook</classname> / <classname alt="boost::intrusive::function_hook">boost::intrusive::function_hook</classname> / <classname alt="boost::intrusive::base_hook">boost::intrusive::base_hook</classname></para>
2564</listitem><listitem><para><classname alt="boost::intrusive::void_pointer">boost::intrusive::void_pointer</classname> / <classname alt="boost::intrusive::tag">boost::intrusive::tag</classname> / <classname alt="boost::intrusive::link_mode">boost::intrusive::link_mode</classname></para>
2565</listitem><listitem><para><classname alt="boost::intrusive::optimize_size">boost::intrusive::optimize_size</classname> / <classname alt="boost::intrusive::linear">boost::intrusive::linear</classname> / <classname alt="boost::intrusive::cache_last">boost::intrusive::cache_last</classname></para>
2566</listitem><listitem><para><classname alt="boost::intrusive::bucket_traits">boost::intrusive::bucket_traits</classname> / <classname alt="boost::intrusive::store_hash">boost::intrusive::store_hash</classname> / <classname alt="boost::intrusive::optimize_multikey">boost::intrusive::optimize_multikey</classname></para>
2567</listitem><listitem><para><classname alt="boost::intrusive::power_2_buckets">boost::intrusive::power_2_buckets</classname> / <classname alt="boost::intrusive::cache_begin">boost::intrusive::cache_begin</classname> / <classname alt="boost::intrusive::compare_hash">boost::intrusive::compare_hash</classname> / <classname alt="boost::intrusive::incremental">boost::intrusive::incremental</classname></para>
2568</listitem></itemizedlist>
2569</para><para>It forward declares the following value traits utilities:<itemizedlist>
2570<listitem><para><classname alt="boost::intrusive::value_traits">boost::intrusive::value_traits</classname> / <classname alt="boost::intrusive::derivation_value_traits">boost::intrusive::derivation_value_traits</classname> / <classname alt="boost::intrusive::trivial_value_traits">boost::intrusive::trivial_value_traits</classname></para>
2571</listitem></itemizedlist>
2572</para><para>Finally it forward declares the following general purpose utilities:<itemizedlist>
2573<listitem><para><classname alt="boost::intrusive::pointer_plus_bits">boost::intrusive::pointer_plus_bits</classname> / boost::intrusive::priority_compare. </para>
2574</listitem></itemizedlist>
2575</para></header>
2576<header name="boost/intrusive/linear_slist_algorithms.hpp">
2577<namespace name="boost">
2578<namespace name="intrusive">
2579<class name="linear_slist_algorithms"><template>
2580      <template-type-parameter name="NodeTraits"/>
2581    </template><description><para><classname alt="boost::intrusive::linear_slist_algorithms">linear_slist_algorithms</classname> provides basic algorithms to manipulate nodes forming a linear singly linked list.</para><para><classname alt="boost::intrusive::linear_slist_algorithms">linear_slist_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the linear list</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_next(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_next(node_ptr n, node_ptr next);</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
2582<typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
2583<typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
2584<typedef name="node_traits"><type>NodeTraits</type></typedef>
2585<method-group name="public static functions">
2586<method name="init" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an non-used list element, putting the next pointer to null: <computeroutput>NodeTraits::get_next(this_node) == node_ptr()</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2587<method name="unique" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" is the only node of a circular list: or it's a not inserted node: <computeroutput>return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2588<method name="inited" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" has the same state as if it was inited using "init(node_ptr)"</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2589<method name="unlink_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the next node of prev_node from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2590<method name="unlink_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="last_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node and last_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the range (prev_node, last_node) from the linear list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2591<method name="link_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be a node of a linear list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node after prev_node in the linear list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2592<method name="transfer_after" specifiers="static"><type>void</type><parameter name="p"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="b"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="e"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be nodes of the same linear list or an empty range. and p must be a node of a different linear list.</para><para><emphasis role="bold">Effects</emphasis>: Removes the nodes from (b, e] range from their linear list and inserts them after p in p's linear list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2593<method name="init_header" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty list, making this_node the only node of the circular list: <computeroutput>NodeTraits::get_next(this_node) == this_node</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2594<method name="get_previous_node" specifiers="static"><type>node_ptr</type><parameter name="prev_init_node"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and prev_init_node must be in the same linear list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of this_node in the linear list starting. the search from prev_init_node. The first node checked for equality is NodeTraits::get_next(prev_init_node).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements between prev_init_node and this_node.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2595<method name="count" specifiers="static"><type>std::size_t</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a linear list or be an empty linear list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes in a linear list. If the linear list is empty, returns 1.</para><para><emphasis role="bold">Complexity</emphasis>: Linear</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2596<method name="swap_trailing_nodes" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and other_node must be nodes inserted in linear lists or be empty linear lists.</para><para><emphasis role="bold">Effects</emphasis>: Moves all the nodes previously chained after this_node after other_node and vice-versa.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2597<method name="reverse" specifiers="static"><type>node_ptr</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Returns</emphasis>: The new first node of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear to the contained elements. </para></description></method>
2598<method name="move_first_n_backwards" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the first n nodes starting at p to the end of the list.</para><para><emphasis role="bold">Returns</emphasis>: A pair containing the new first and last node of the list or if there has been any movement, a null pair if n leads to no movement.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number moved positions. </para></description></method>
2599<method name="move_first_n_forward" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the first n nodes starting at p to the beginning of the list.</para><para><emphasis role="bold">Returns</emphasis>: A pair containing the new first and last node of the list or if there has been any movement, a null pair if n leads to no movement.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number moved positions. </para></description></method>
2600</method-group>
2601</class>
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653</namespace>
2654</namespace>
2655</header>
2656<header name="boost/intrusive/link_mode.hpp">
2657<namespace name="boost">
2658<namespace name="intrusive">
2659<enum name="link_mode_type"><enumvalue name="normal_link"><description><para>If this linking policy is specified in a <classname alt="boost::intrusive::value_traits">value_traits</classname> class as the <classname alt="boost::intrusive::link_mode">link_mode</classname>, containers configured with such <classname alt="boost::intrusive::value_traits">value_traits</classname> won't set the hooks of the erased values to a default state. Containers also won't check that the hooks of the new values are default initialized. </para></description></enumvalue><enumvalue name="safe_link"><description><para>If this linking policy is specified in a <classname alt="boost::intrusive::value_traits">value_traits</classname> class as the <classname alt="boost::intrusive::link_mode">link_mode</classname>, containers configured with such <classname alt="boost::intrusive::value_traits">value_traits</classname> will set the hooks of the erased values to a default state. Containers also will check that the hooks of the new values are default initialized. </para></description></enumvalue><enumvalue name="auto_unlink"><description><para>Same as "safe_link" but the user type is an auto-unlink type, so the containers with constant-time size features won't be compatible with <classname alt="boost::intrusive::value_traits">value_traits</classname> configured with this policy. Containers also know that the a value can be silently erased from the container without using any function provided by the containers. </para></description></enumvalue><description><para>This enumeration defines the type of <classname alt="boost::intrusive::value_traits">value_traits</classname> that can be defined for Boost.Intrusive containers </para></description></enum>
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712</namespace>
2713</namespace>
2714</header>
2715<header name="boost/intrusive/list.hpp">
2716<namespace name="boost">
2717<namespace name="intrusive">
2718<class name="list"><template>
2719      <template-type-parameter name="T"/>
2720      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
2721    </template><description><para>The class template list is an intrusive container that mimics most of the interface of std::list as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput> and <computeroutput>size_type&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
2722<typedef name="pointer"><type>value_traits::pointer</type></typedef>
2723<typedef name="const_pointer"><type>value_traits::const_pointer</type></typedef>
2724<typedef name="value_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::element_type</type></typedef>
2725<typedef name="reference"><type><classname>pointer_traits</classname>&lt; pointer &gt;::reference</type></typedef>
2726<typedef name="const_reference"><type><classname>pointer_traits</classname>&lt; const_pointer &gt;::reference</type></typedef>
2727<typedef name="difference_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::difference_type</type></typedef>
2728<typedef name="size_type"><type>SizeType</type></typedef>
2729<typedef name="iterator"><type>list_iterator&lt; value_traits, false &gt;</type></typedef>
2730<typedef name="const_iterator"><type>list_iterator&lt; value_traits, true &gt;</type></typedef>
2731<typedef name="reverse_iterator"><type>boost::intrusive::reverse_iterator&lt; iterator &gt;</type></typedef>
2732<typedef name="const_reverse_iterator"><type>boost::intrusive::reverse_iterator&lt; const_iterator &gt;</type></typedef>
2733<typedef name="node_traits"><type>value_traits::node_traits</type></typedef>
2734<typedef name="node"><type>node_traits::node</type></typedef>
2735<typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
2736<typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
2737<typedef name="node_algorithms"><type><classname>circular_list_algorithms</classname>&lt; node_traits &gt;</type></typedef>
2738<typedef name="header_holder_type"><type><emphasis>unspecified</emphasis></type></typedef>
2739<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
2740<data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
2741<data-member name="has_container_from_iterator" specifiers="static"><type>const bool</type></data-member>
2742<method-group name="public member functions">
2743<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the back of the list. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
2744<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the front of the list. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
2745<method name="pop_back"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases the last element of the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
2746<method name="pop_back_and_dispose"><type>void</type><template>
2747          <template-type-parameter name="Disposer"/>
2748        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the last element of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
2749<method name="pop_front"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases the first element of the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
2750<method name="pop_front_and_dispose"><type>void</type><template>
2751          <template-type-parameter name="Disposer"/>
2752        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the first element of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
2753<method name="front"><type>reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reference to the first element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2754<method name="front" cv="const"><type>const_reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reference to the first element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2755<method name="back"><type>reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reference to the last element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2756<method name="back" cv="const"><type>const_reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reference to the last element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2757<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2758<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2759<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2760<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2761<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2762<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a constant iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2763<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2764<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2765<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2766<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2767<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2768<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2769<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of the elements contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements contained in the list. if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
2770<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the list contains no elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
2771<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>list</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the elements of x and *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
2772<method name="shift_backwards"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><default>1</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves backwards all the elements, so that the first element becomes the second, the second becomes the third... the last element becomes the first one.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of shifts.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
2773<method name="shift_forward"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><default>1</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves forward all the elements, so that the second element becomes the first, the third becomes the second... the first element becomes the last one.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of shifts.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
2774<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed by i of the list. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed element, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
2775<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be valid iterators to elements in *this.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element range pointed by b and e No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of erased elements if it's a safe-mode or auto-unlink value, or constant-time size is enabled. Constant-time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
2776<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be valid iterators to elements in *this. n must be distance(b, e).</para><para><emphasis role="bold">Effects</emphasis>: Erases the element range pointed by b and e No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of erased elements if it's a safe-mode or auto-unlink value is enabled. Constant-time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
2777<method name="erase_and_dispose"><type>iterator</type><template>
2778          <template-type-parameter name="Disposer"/>
2779        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed by i of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed element, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
2780<method name="erase_and_dispose"><type>iterator</type><template>
2781          <template-type-parameter name="Disposer"/>
2782        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element range pointed by b and e No destructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements erased.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
2783<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements of the container. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of the list. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
2784<method name="clear_and_dispose"><type>void</type><template>
2785          <template-type-parameter name="Disposer"/>
2786        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements of the container. No destructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of the list.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
2787<method name="clone_from"><type>void</type><template>
2788          <template-type-parameter name="Cloner"/>
2789          <template-type-parameter name="Disposer"/>
2790        </template><parameter name="src"><paramtype>const <classname>list</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws. Basic guarantee. </para></description></method>
2791<method name="clone_from"><type>void</type><template>
2792          <template-type-parameter name="Cloner"/>
2793          <template-type-parameter name="Disposer"/>
2794        </template><parameter name="src"><paramtype><classname>list</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws. Basic guarantee. </para></description></method>
2795<method name="insert"><type>iterator</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and p must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value before the position pointed by p.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the inserted element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time. No copy constructors are called.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
2796<method name="insert"><type>void</type><template>
2797          <template-type-parameter name="Iterator"/>
2798        </template><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type and p must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the range pointed by b and e before the position p. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
2799<method name="assign"><type>void</type><template>
2800          <template-type-parameter name="Iterator"/>
2801        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements contained in the list if it's a safe-mode or auto-unlink value. Linear to the number of elements inserted in the list otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
2802<method name="dispose_and_assign"><type>void</type><template>
2803          <template-type-parameter name="Iterator"/>
2804          <template-type-parameter name="Disposer"/>
2805        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements contained in the list.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
2806<method name="splice"><type>void</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Transfers all the elements of list x to this list, before the the element pointed by p. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
2807<method name="splice"><type>void</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><parameter name="new_ele"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a valid iterator of *this. new_ele must point to an element contained in list x.</para><para><emphasis role="bold">Effects</emphasis>: Transfers the value pointed by new_ele, from list x to this list, before the element pointed by p. No destructors or copy constructors are called. If p == new_ele or p == ++new_ele, this function is a null operation.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
2808<method name="splice"><type>void</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a valid iterator of *this. f and e must point to elements contained in list x.</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range pointed by f and e from list x to this list, before the element pointed by p. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements transferred if constant-time size option is enabled. Constant-time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
2809<method name="splice"><type>void</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a valid iterator of *this. f and e must point to elements contained in list x. n == distance(f, e)</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range pointed by f and e from list x to this list, before the element pointed by p. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
2810<method name="sort"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: This function sorts the list *this according to std::less&lt;value_type&gt;. The sort is stable, that is, the relative order of equivalent elements is preserved.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or std::less&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Notes</emphasis>: Iterators and references are not invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: The number of comparisons is approximately N log N, where N is the list's size. </para></description></method>
2811<method name="sort"><type>void</type><template>
2812          <template-type-parameter name="Predicate"/>
2813        </template><parameter name="p"><paramtype>Predicate</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a comparison function that induces a strict weak ordering</para><para><emphasis role="bold">Effects</emphasis>: This function sorts the list *this according to p. The sort is stable, that is, the relative order of equivalent elements is preserved.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This won't throw if list_base_hook&lt;&gt; or <classname alt="boost::intrusive::list_member_hook">list_member_hook</classname> are used. Iterators and references are not invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: The number of comparisons is approximately N log N, where N is the list's size. </para></description></method>
2814<method name="merge"><type>void</type><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this according to std::less&lt;value_type&gt;. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Throws</emphasis>: If std::less&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
2815<method name="merge"><type>void</type><template>
2816          <template-type-parameter name="Predicate"/>
2817        </template><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><parameter name="p"><paramtype>Predicate</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.</para><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
2818<method name="reverse"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
2819<method name="remove"><type>void</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes all the elements that compare equal to value. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
2820<method name="remove_and_dispose"><type>void</type><template>
2821          <template-type-parameter name="Disposer"/>
2822        </template><parameter name="value"><paramtype>const_reference</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes all the elements that compare equal to value. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
2823<method name="remove_if"><type>void</type><template>
2824          <template-type-parameter name="Pred"/>
2825        </template><parameter name="pred"><paramtype>Pred</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes all the elements for which a specified predicate is satisfied. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() calls to the predicate.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
2826<method name="remove_and_dispose_if"><type>void</type><template>
2827          <template-type-parameter name="Pred"/>
2828          <template-type-parameter name="Disposer"/>
2829        </template><parameter name="pred"><paramtype>Pred</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes all the elements for which a specified predicate is satisfied. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
2830<method name="unique"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that are equal from the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1 comparisons calls to pred()).</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
2831<method name="unique"><type>void</type><template>
2832          <template-type-parameter name="BinaryPredicate"/>
2833        </template><parameter name="pred"><paramtype>BinaryPredicate</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1 comparisons equality comparisons).</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
2834<method name="unique_and_dispose"><type>void</type><template>
2835          <template-type-parameter name="Disposer"/>
2836        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that are equal from the list. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
2837<method name="unique_and_dispose"><type>void</type><template>
2838          <template-type-parameter name="BinaryPredicate"/>
2839          <template-type-parameter name="Disposer"/>
2840        </template><parameter name="pred"><paramtype>BinaryPredicate</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
2841<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns a const_iterator pointing to the element</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
2842<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a const reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns an iterator pointing to the element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
2843<method name="check" cv="const"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
2844</method-group>
2845<constructor><description><para><emphasis role="bold">Effects</emphasis>: constructs an empty list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
2846<constructor specifiers="explicit"><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: constructs an empty list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
2847<constructor><template>
2848          <template-type-parameter name="Iterator"/>
2849        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs a list equal to the range [first,last).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in distance(b, e). No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
2850<constructor><parameter name="x"><paramtype><classname>list</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of value traits throws. </para></description></constructor>
2851<copy-assignment><type><classname>list</classname> &amp;</type><parameter name="x"><paramtype><classname>list</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
2852<destructor><description><para><emphasis role="bold">Effects</emphasis>: If it's not a safe-mode or an auto-unlink value_type the destructor does nothing (ie. no code is generated). Otherwise it detaches all elements from this. In this case the objects in the list are not deleted (i.e. no destructors are called), but the hooks according to the ValueTraits template parameter are set to their default value.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the list, if it's a safe-mode or auto-unlink value . Otherwise constant. </para></description></destructor>
2853<method-group name="public static functions">
2854<method name="container_from_end_iterator" specifiers="static"><type><classname>list</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of list.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the list associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2855<method name="container_from_end_iterator" specifiers="static"><type>const <classname>list</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end const_iterator of list.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the list associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
2856<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns a const_iterator pointing to the element</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
2857<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a const reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns an iterator pointing to the element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
2858</method-group>
2859</class><struct name="make_list"><template>
2860      <template-type-parameter name="T"/>
2861      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
2862    </template><description><para>Helper metafunction to define a <computeroutput>list</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
2863</struct>
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915</namespace>
2916</namespace>
2917</header>
2918<header name="boost/intrusive/list_hook.hpp">
2919<namespace name="boost">
2920<namespace name="intrusive">
2921<class name="list_base_hook"><template>
2922      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
2923    </template><inherit access="public">make_list_base_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Derive a class from this hook in order to store objects of that class in an list.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
2924<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>list_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2925<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>list::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
2926<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2927</method-group>
2928<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
2929<constructor><parameter name=""><paramtype>const <classname>list_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
2930<copy-assignment><type><classname>list_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>list_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
2931<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an list an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
2932</class><class name="list_member_hook"><template>
2933      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
2934    </template><inherit access="public">make_list_member_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Store this hook in a class to be inserted in an list.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
2935<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>list_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2936<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>list::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
2937<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
2938</method-group>
2939<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
2940<constructor><parameter name=""><paramtype>const <classname>list_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
2941<copy-assignment><type><classname>list_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>list_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
2942<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an list an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
2943</class><struct name="make_list_base_hook"><template>
2944      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
2945    </template><description><para>Helper metafunction to define a <computeroutput><computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> that</computeroutput> yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
2946</struct><struct name="make_list_member_hook"><template>
2947      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
2948    </template><description><para>Helper metafunction to define a <computeroutput><computeroutput><classname alt="boost::intrusive::list_member_hook">list_member_hook</classname></computeroutput> that</computeroutput> yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
2949</struct>
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001</namespace>
3002</namespace>
3003</header>
3004<header name="boost/intrusive/member_value_traits.hpp">
3005<namespace name="boost">
3006<namespace name="intrusive">
3007<struct name="member_value_traits"><template>
3008      <template-type-parameter name="T"/>
3009      <template-type-parameter name="NodeTraits"/>
3010      <template-nontype-parameter name="PtrToMember"><type>typename NodeTraits::node T::*</type></template-nontype-parameter>
3011      <template-nontype-parameter name="LinkMode"><type>link_mode_type</type><default>safe_link</default></template-nontype-parameter>
3012    </template><description><para>This value traits template is used to create value traits from user defined node traits where value_traits::value_type will store a node_traits::node </para></description><typedef name="node_traits"><type>NodeTraits</type></typedef>
3013<typedef name="value_type"><type>T</type></typedef>
3014<typedef name="node"><type>node_traits::node</type></typedef>
3015<typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
3016<typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
3017<typedef name="node_ptr_traits"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;</type></typedef>
3018<typedef name="pointer"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::template rebind_pointer&lt; T &gt;::type</type></typedef>
3019<typedef name="const_pointer"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::template rebind_pointer&lt; const T &gt;::type</type></typedef>
3020<typedef name="reference"><type>value_type &amp;</type></typedef>
3021<typedef name="const_reference"><type>const value_type &amp;</type></typedef>
3022<data-member name="link_mode" specifiers="static"><type>const link_mode_type</type></data-member>
3023<method-group name="public static functions">
3024<method name="to_node_ptr" specifiers="static"><type>node_ptr</type><parameter name="value"><paramtype>reference</paramtype></parameter></method>
3025<method name="to_node_ptr" specifiers="static"><type>const_node_ptr</type><parameter name="value"><paramtype>const_reference</paramtype></parameter></method>
3026<method name="to_value_ptr" specifiers="static"><type>pointer</type><parameter name="n"><paramtype>const node_ptr &amp;</paramtype></parameter></method>
3027<method name="to_value_ptr" specifiers="static"><type>const_pointer</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter></method>
3028</method-group>
3029</struct>
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081</namespace>
3082</namespace>
3083</header>
3084<header name="boost/intrusive/options.hpp">
3085<namespace name="boost">
3086<namespace name="intrusive">
3087<struct name="base_hook"><template>
3088      <template-type-parameter name="BaseHook"/>
3089    </template><description><para>This option setter specifies that the container must use the specified base hook </para></description></struct><struct name="bucket_traits"><template>
3090      <template-type-parameter name="BucketTraits"/>
3091    </template><description><para>This option setter specifies the bucket traits class for unordered associative containers. When this option is specified, instead of using the default bucket traits, a user defined holder will be defined </para></description></struct><struct name="cache_begin"><template>
3092      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3093    </template><description><para>This option setter specifies if the container will cache a pointer to the first non-empty bucket so that begin() is always constant-time. This is specially helpful when we can have containers with a few elements but with big bucket arrays (that is, hashtables with low load factors). </para></description></struct><struct name="cache_last"><template>
3094      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3095    </template><description><para>If true, slist also stores a pointer to the last element of the singly linked list. This allows O(1) swap and splice_after(iterator, slist &amp;) for circular slists and makes possible new functions like push_back(reference) and back(). </para></description></struct><struct name="compare"><template>
3096      <template-type-parameter name="Compare"/>
3097    </template><description><para>This option setter specifies the strict weak ordering comparison functor for the value type </para></description></struct><struct name="compare_hash"><template>
3098      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3099    </template><description><para>This option setter specifies if the container will compare the hash value before comparing objects. This option can't be specified if store_hash&lt;&gt; is not true. This is specially helpful when we have containers with a high load factor. and the comparison function is much more expensive that comparing already stored hash values. </para></description></struct><struct name="constant_time_size"><template>
3100      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3101    </template><description><para>This option setter specifies if the intrusive container stores its size as a member to obtain constant-time size() member. </para></description></struct><struct name="equal"><template>
3102      <template-type-parameter name="Equal"/>
3103    </template><description><para>This option setter specifies the equality functor for the value type </para></description></struct><struct name="floating_point"><template>
3104      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3105    </template><description><para>This option setter for scapegoat containers specifies if the intrusive scapegoat container should use a non-variable alpha value that does not need floating-point operations.</para><para>If activated, the fixed alpha value is 1/sqrt(2). This option also saves some space in the container since the alpha value and some additional data does not need to be stored in the container.</para><para>If the user only needs an alpha value near 1/sqrt(2), this option also improves performance since avoids logarithm and division operations when rebalancing the tree. </para></description></struct><struct name="function_hook"><template>
3106      <template-type-parameter name="Functor"/>
3107    </template><description><para>This option setter specifies the function object that will be used to convert between values to be inserted in a container and the hook to be used for that purpose. </para></description></struct><struct name="hash"><template>
3108      <template-type-parameter name="Hash"/>
3109    </template><description><para>This option setter specifies the hash functor for the value type </para></description></struct><struct name="header_holder_type"><template>
3110      <template-type-parameter name="HeaderHolder"/>
3111    </template><purpose>This option setter specifies a container header holder type. </purpose></struct><struct name="incremental"><template>
3112      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3113    </template><description><para>This option setter specifies if the hash container will use incremental hashing. With incremental hashing the cost of hash table expansion is spread out across each hash table insertion operation, as opposed to be incurred all at once. Therefore linear hashing is well suited for interactive applications or real-time appplications where the worst-case insertion time of non-incremental hash containers (rehashing the whole bucket array) is not admisible. </para></description></struct><struct name="key_of_value"><template>
3114      <template-type-parameter name="KeyOfValue"/>
3115    </template><description><para>This option setter specifies a function object that specifies the type of the key of an associative container and an operator to obtain it from a value type.</para><para>This function object must the define a <computeroutput>type</computeroutput> member typedef and a member with signature <computeroutput>type [const&amp;] operator()(const value_type &amp;) const</computeroutput> that will return the key from a value_type of an associative container </para></description></struct><struct name="linear"><template>
3116      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3117    </template><description><para>This option setter specifies if the slist container should use a linear implementation instead of a circular one. </para></description></struct><struct name="link_mode"><template>
3118      <template-nontype-parameter name="LinkType"><type>link_mode_type</type></template-nontype-parameter>
3119    </template><description><para>This option setter specifies the link mode (normal_link, safe_link or auto_unlink) </para></description></struct><struct name="member_hook"><template>
3120      <template-type-parameter name="Parent"/>
3121      <template-type-parameter name="MemberHook"/>
3122      <template-nontype-parameter name="PtrToMember"><type>MemberHook Parent::*</type></template-nontype-parameter>
3123    </template><description><para>This option setter specifies the member hook the container must use. </para></description></struct><struct name="optimize_multikey"><template>
3124      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3125    </template><description><para>This option setter specifies if the unordered hook should offer room to store another link to another node with the same key. Storing this link will speed up lookups and insertions on <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> containers with a great number of elements with the same key. </para></description></struct><struct name="optimize_size"><template>
3126      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3127    </template><description><para>This option setter specifies if the hook should be optimized for size instead of for speed. </para></description></struct><struct name="power_2_buckets"><template>
3128      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3129    </template><description><para>This option setter specifies if the bucket array will be always power of two. This allows using masks instead of the default modulo operation to determine the bucket number from the hash value, leading to better performance. In debug mode, if power of two buckets mode is activated, the bucket length will be checked with assertions. </para></description></struct><struct name="priority"><template>
3130      <template-type-parameter name="Priority"/>
3131    </template><description><para>This option setter specifies the priority comparison functor for the value type </para></description></struct><struct name="priority_of_value"><template>
3132      <template-type-parameter name="PrioOfValue"/>
3133    </template><description><para>This option setter specifies a function object that specifies the type of the priority of a treap container and an operator to obtain it from a value type.</para><para>This function object must the define a <computeroutput>type</computeroutput> member typedef and a member with signature <computeroutput>type [const&amp;] operator()(const value_type &amp;) const</computeroutput> that will return the priority from a value_type of a treap container </para></description></struct><struct name="size_type"><template>
3134      <template-type-parameter name="SizeType"/>
3135    </template><description><para>This option setter specifies the type that the container will use to store its size. </para></description></struct><struct name="store_hash"><template>
3136      <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
3137    </template><description><para>This option setter specifies if the unordered hook should offer room to store the hash value. Storing the hash in the hook will speed up rehashing processes in applications where rehashing is frequent, rehashing might throw or the value is heavy to hash. </para></description></struct><struct name="tag"><template>
3138      <template-type-parameter name="Tag"/>
3139    </template><description><para>This option setter specifies the type of the tag of a base hook. A type cannot have two base hooks of the same type, so a tag can be used to differentiate two base hooks with otherwise same type </para></description></struct><struct name="value_traits"><template>
3140      <template-type-parameter name="ValueTraits"/>
3141    </template><description><para>This option setter specifies the relationship between the type to be managed by the container (the value type) and the node to be used in the node algorithms. It also specifies the linking policy. </para></description></struct><struct name="void_pointer"><template>
3142      <template-type-parameter name="VoidPointer"/>
3143    </template><description><para>This option setter specifies the type of a void pointer. This will instruct the hook to use this type of pointer instead of the default one </para></description></struct>
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195</namespace>
3196</namespace>
3197</header>
3198<header name="boost/intrusive/pack_options.hpp">
3199<namespace name="boost">
3200<namespace name="intrusive">
3201<struct name="pack_options"><template>
3202      <template-type-parameter name="DefaultOptions"/>
3203      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
3204    </template><description><para>This class is a utility that takes:<itemizedlist>
3205<listitem><para>a default options class defining initial static constant and typedefs</para>
3206</listitem><listitem><para>several options defined with BOOST_INTRUSIVE_OPTION_CONSTANT and BOOST_INTRUSIVE_OPTION_TYPE</para>
3207</listitem></itemizedlist>
3208</para><para>and packs them together in a new type that defines all options as member typedefs or static constant values. Given options of form:</para><para><programlisting language="c++">BOOST_INTRUSIVE_OPTION_TYPE(my_pointer, VoidPointer, VoidPointer, my_pointer_type)
3209BOOST_INTRUSIVE_OPTION_CONSTANT(incremental, bool, Enabled, is_incremental)
3210</programlisting></para><para>the following expression</para><para><programlisting language="c++">struct default_options
3211{
3212  typedef long      int_type;
3213  static const int  int_constant = -1;
3214};
3215
3216pack_options&lt; default_options, my_pointer&lt;void*&gt;, incremental&lt;true&gt; &gt;::type
3217</programlisting></para><para>will create a type that will contain the following typedefs/constants</para><para><programlisting language="c++">struct unspecified_type
3218{
3219   //Default options
3220   typedef long      int_type;
3221   static const int  int_constant  = -1;
3222
3223   //Packed options (will ovewrite any default option)
3224   typedef void*     my_pointer_type;
3225   static const bool is_incremental = true;
3226};
3227</programlisting></para><para>If an option is specified in the default options argument and later redefined as an option, the last definition will prevail. </para></description><typedef name="type"><type>unspecified_type</type></typedef>
3228</struct>
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280</namespace>
3281</namespace>
3282<macro name="BOOST_INTRUSIVE_OPTION_TYPE" kind="functionlike"><macro-parameter name="OPTION_NAME"/><macro-parameter name="TYPE"/><macro-parameter name="TYPEDEF_EXPR"/><macro-parameter name="TYPEDEF_NAME"/><description><para>Defines an option class of name OPTION_NAME that can be used to specify a type of type TYPE...</para><para><programlisting language="c++">struct OPTION_NAME&lt;class TYPE&gt;
3283{  unspecified_content  };
3284</programlisting></para><para>...that after being combined with <computeroutput><classname alt="boost::intrusive::pack_options">boost::intrusive::pack_options</classname></computeroutput>, will typedef TYPE as a typedef of name TYPEDEF_NAME. Example:</para><para><programlisting language="c++">//[includes and namespaces omitted for brevity]
3285
3286//This macro will create the following class:
3287//    template&lt;class VoidPointer&gt;
3288//    struct my_pointer
3289//    { unspecified_content };
3290BOOST_INTRUSIVE_OPTION_TYPE(my_pointer, VoidPointer, boost::remove_pointer&lt;VoidPointer&gt;::type, my_pointer_type)
3291
3292struct empty_default{};
3293
3294typedef pack_options&lt; empty_default, typename my_pointer&lt;void*&gt; &gt;::type::my_pointer_type type;
3295
3296BOOST_STATIC_ASSERT(( boost::is_same&lt;type, void&gt;::value ));
3297</programlisting> </para></description></macro>
3298<macro name="BOOST_INTRUSIVE_OPTION_CONSTANT" kind="functionlike"><macro-parameter name="OPTION_NAME"/><macro-parameter name="TYPE"/><macro-parameter name="VALUE"/><macro-parameter name="CONSTANT_NAME"/><description><para>Defines an option class of name OPTION_NAME that can be used to specify a constant of type TYPE with value VALUE...</para><para><programlisting language="c++">struct OPTION_NAME&lt;TYPE VALUE&gt;
3299{  unspecified_content  };
3300</programlisting></para><para>...that after being combined with <computeroutput><classname alt="boost::intrusive::pack_options">boost::intrusive::pack_options</classname></computeroutput>, will contain a CONSTANT_NAME static constant of value VALUE. Example:</para><para><programlisting language="c++">//[includes and namespaces omitted for brevity]
3301
3302//This macro will create the following class:
3303//    template&lt;bool Enabled&gt;
3304//    struct incremental
3305//    { unspecified_content };
3306BOOST_INTRUSIVE_OPTION_CONSTANT(incremental, bool, Enabled, is_incremental)
3307
3308struct empty_default{};
3309
3310const bool is_incremental = pack_options&lt; empty_default, incremental&lt;true&gt; &gt;::type::is_incremental;
3311
3312BOOST_STATIC_ASSERT(( is_incremental == true ));
3313</programlisting> </para></description></macro>
3314</header>
3315<header name="boost/intrusive/parent_from_member.hpp">
3316<namespace name="boost">
3317<namespace name="intrusive">
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348<function name="get_parent_from_member"><type>Parent *</type><template>
3349          <template-type-parameter name="Parent"/>
3350          <template-type-parameter name="Member"/>
3351        </template><parameter name="member"><paramtype>Member *</paramtype></parameter><parameter name="ptr_to_member"><paramtype>const Member Parent::*</paramtype></parameter><description><para>Given a pointer to a member and its corresponding pointer to data member, this function returns the pointer of the parent containing that member. Note: this function does not work with pointer to members that rely on virtual inheritance. </para></description></function>
3352<function name="get_parent_from_member"><type>const Parent *</type><template>
3353          <template-type-parameter name="Parent"/>
3354          <template-type-parameter name="Member"/>
3355        </template><parameter name="member"><paramtype>const Member *</paramtype></parameter><parameter name="ptr_to_member"><paramtype>const Member Parent::*</paramtype></parameter><description><para>Given a const pointer to a member and its corresponding const pointer to data member, this function returns the const pointer of the parent containing that member. Note: this function does not work with pointer to members that rely on virtual inheritance. </para></description></function>
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376</namespace>
3377</namespace>
3378</header>
3379<header name="boost/intrusive/pointer_plus_bits.hpp">
3380<namespace name="boost">
3381<namespace name="intrusive">
3382<struct name="max_pointer_plus_bits"><template>
3383      <template-type-parameter name="VoidPointer"/>
3384      <template-nontype-parameter name="Alignment"><type>std::size_t</type></template-nontype-parameter>
3385    </template><description><para>This trait class is used to know if a pointer can embed extra bits of information if it's going to be used to point to objects with an alignment of "Alignment" bytes. </para></description><data-member name="value" specifiers="static"><type>const std::size_t</type></data-member>
3386</struct><struct-specialization name="max_pointer_plus_bits"><template>
3387      <template-nontype-parameter name="Alignment"><type>std::size_t</type></template-nontype-parameter>
3388    </template><specialization><template-arg>void *</template-arg><template-arg>Alignment</template-arg></specialization><description><para>This is a specialization for raw pointers. Raw pointers can embed extra bits in the lower bits if the alignment is multiple of 2pow(NumBits). </para></description><data-member name="value" specifiers="static"><type>const std::size_t</type></data-member>
3389</struct-specialization><struct name="pointer_plus_bits"><template>
3390      <template-type-parameter name="Pointer"/>
3391      <template-nontype-parameter name="NumBits"><type>std::size_t</type></template-nontype-parameter>
3392    </template><description><para>This is class that is supposed to have static methods to embed extra bits of information in a pointer. This is a declaration and there is no default implementation, because operations to embed the bits change with every pointer type.</para><para>An implementation that detects that a pointer type whose has_pointer_plus_bits&lt;&gt;::value is non-zero can make use of these operations to embed the bits in the pointer. </para></description></struct><struct-specialization name="pointer_plus_bits"><template>
3393      <template-type-parameter name="T"/>
3394      <template-nontype-parameter name="NumBits"><type>std::size_t</type></template-nontype-parameter>
3395    </template><specialization><template-arg>T *</template-arg><template-arg>NumBits</template-arg></specialization><description><para>This is the specialization to embed extra bits of information in a raw pointer. The extra bits are stored in the lower bits of the pointer. </para></description><typedef name="pointer"><type>T *</type></typedef>
3396<data-member name="Mask" specifiers="static"><type>const uintptr_t</type></data-member>
3397<method-group name="public static functions">
3398<method name="get_pointer" specifiers="static"><type>pointer</type><parameter name="n"><paramtype>pointer</paramtype></parameter></method>
3399<method name="set_pointer" specifiers="static"><type>void</type><parameter name="n"><paramtype>pointer &amp;</paramtype></parameter><parameter name="p"><paramtype>pointer</paramtype></parameter></method>
3400<method name="get_bits" specifiers="static"><type>std::size_t</type><parameter name="n"><paramtype>pointer</paramtype></parameter></method>
3401<method name="set_bits" specifiers="static"><type>void</type><parameter name="n"><paramtype>pointer &amp;</paramtype></parameter><parameter name="c"><paramtype>std::size_t</paramtype></parameter></method>
3402</method-group>
3403</struct-specialization>
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455</namespace>
3456</namespace>
3457</header>
3458<header name="boost/intrusive/pointer_rebind.hpp">
3459<namespace name="boost">
3460<namespace name="intrusive">
3461<struct name="pointer_has_rebind"><template>
3462      <template-type-parameter name="Ptr"/>
3463      <template-type-parameter name="U"/>
3464    </template><struct name="any"><template>
3465      <template-type-parameter name="V"/>
3466    </template><method-group name="public member functions">
3467</method-group>
3468<constructor><parameter name=""><paramtype>const V &amp;</paramtype></parameter></constructor>
3469</struct><data-member name="value" specifiers="static"><type>const bool</type></data-member>
3470<method-group name="public static functions">
3471<method name="test" specifiers="static"><type>char</type><template>
3472          <template-type-parameter name="X"/>
3473        </template><parameter name=""><paramtype>int</paramtype></parameter><parameter name=""><paramtype>typename X::template rebind&lt; U &gt; *</paramtype></parameter></method>
3474<method name="test" specifiers="static"><type>int</type><template>
3475          <template-type-parameter name="X"/>
3476        </template><parameter name=""><paramtype>any&lt; int &gt;</paramtype></parameter><parameter name=""><paramtype>void *</paramtype></parameter></method>
3477</method-group>
3478</struct><struct name="pointer_has_rebind_other"><template>
3479      <template-type-parameter name="Ptr"/>
3480      <template-type-parameter name="U"/>
3481    </template><struct name="any"><template>
3482      <template-type-parameter name="V"/>
3483    </template><method-group name="public member functions">
3484</method-group>
3485<constructor><parameter name=""><paramtype>const V &amp;</paramtype></parameter></constructor>
3486</struct><data-member name="value" specifiers="static"><type>const bool</type></data-member>
3487<method-group name="public static functions">
3488<method name="test" specifiers="static"><type>char</type><template>
3489          <template-type-parameter name="X"/>
3490        </template><parameter name=""><paramtype>int</paramtype></parameter><parameter name=""><paramtype>typename X::template rebind&lt; U &gt;::other *</paramtype></parameter></method>
3491<method name="test" specifiers="static"><type>int</type><template>
3492          <template-type-parameter name="X"/>
3493        </template><parameter name=""><paramtype>any&lt; int &gt;</paramtype></parameter><parameter name=""><paramtype>void *</paramtype></parameter></method>
3494</method-group>
3495</struct><struct name="pointer_rebind"><template>
3496      <template-type-parameter name="Ptr"/>
3497      <template-type-parameter name="U"/>
3498    </template><inherit access="public">boost::intrusive::pointer_rebinder&lt; Ptr, U, pointer_rebind_mode&lt; Ptr, U &gt;::mode &gt;</inherit><purpose>defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) </purpose></struct><struct-specialization name="pointer_rebind"><template>
3499      <template-type-parameter name="T"/>
3500      <template-type-parameter name="U"/>
3501    </template><specialization><template-arg>T *</template-arg><template-arg>U</template-arg></specialization><typedef name="type"><type>U *</type></typedef>
3502</struct-specialization><struct name="pointer_rebind_mode"><template>
3503      <template-type-parameter name="Ptr"/>
3504      <template-type-parameter name="U"/>
3505    </template><data-member name="rebind" specifiers="static"><type>const unsigned int</type></data-member>
3506<data-member name="rebind_other" specifiers="static"><type>const unsigned int</type></data-member>
3507<data-member name="mode" specifiers="static"><type>const unsigned int</type></data-member>
3508</struct><struct name="pointer_rebinder"><template>
3509      <template-type-parameter name="Ptr"/>
3510      <template-type-parameter name="U"/>
3511      <template-nontype-parameter name="RebindMode"><type>unsigned int</type></template-nontype-parameter>
3512    </template></struct><struct-specialization name="pointer_rebinder"><template>
3513      <template-type-parameter name="Ptr"/>
3514      <template-type-parameter name="U"/>
3515    </template><specialization><template-arg>Ptr</template-arg><template-arg>U</template-arg><template-arg>1u</template-arg></specialization><typedef name="type"><type>Ptr::template rebind&lt; U &gt;</type></typedef>
3516</struct-specialization><struct-specialization name="pointer_rebinder"><template>
3517      <template-type-parameter name="Ptr"/>
3518      <template-type-parameter name="U"/>
3519    </template><specialization><template-arg>Ptr</template-arg><template-arg>U</template-arg><template-arg>2u</template-arg></specialization><typedef name="type"><type>Ptr::template rebind&lt; U &gt;::other</type></typedef>
3520</struct-specialization><struct-specialization name="pointer_rebinder"><template>
3521      <template-nontype-parameter name="Ptr"><type>template&lt; class &gt; class</type></template-nontype-parameter>
3522      <template-type-parameter name="A"/>
3523      <template-type-parameter name="U"/>
3524    </template><specialization><template-arg>Ptr&lt; A &gt;</template-arg><template-arg>U</template-arg><template-arg>0u</template-arg></specialization><typedef name="type"><type>Ptr&lt; U &gt;</type></typedef>
3525</struct-specialization><struct-specialization name="pointer_rebinder"><template>
3526      <template-nontype-parameter name="Ptr"><type>template&lt; class, class... &gt; class</type></template-nontype-parameter>
3527      <template-type-parameter name="A"/>
3528      <template-nontype-parameter name="An"><type>class...</type></template-nontype-parameter>
3529      <template-type-parameter name="U"/>
3530    </template><specialization><template-arg>Ptr&lt; A</template-arg><template-arg>An... &gt;</template-arg><template-arg>U</template-arg><template-arg>0u</template-arg></specialization><typedef name="type"><type>Ptr&lt; U, An... &gt;</type></typedef>
3531</struct-specialization>
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583</namespace>
3584</namespace>
3585</header>
3586<header name="boost/intrusive/pointer_traits.hpp">
3587<namespace name="boost">
3588<namespace name="intrusive">
3589<struct name="pointer_traits"><template>
3590      <template-type-parameter name="Ptr"/>
3591    </template><description><para><classname alt="boost::intrusive::pointer_traits">pointer_traits</classname> is the implementation of C++11 std::pointer_traits class with some extensions like castings.</para><para><classname alt="boost::intrusive::pointer_traits">pointer_traits</classname> supplies a uniform interface to certain attributes of pointer-like types.</para><para><emphasis role="bold">Note</emphasis>: When defining a custom family of pointers or references to be used with BI library, make sure the public static conversion functions accessed through the <computeroutput><classname alt="boost::intrusive::pointer_traits">pointer_traits</classname></computeroutput> interface (<computeroutput>*_cast_from</computeroutput> and <computeroutput>pointer_to</computeroutput>) can properly convert between const and nonconst referred member types <emphasis role="bold">without the use of implicit constructor calls</emphasis>. It is suggested these conversions be implemented as function templates, where the template argument is the type of the object being converted from. </para></description><typedef name="pointer"><description><para>The pointer type queried by this <classname alt="boost::intrusive::pointer_traits">pointer_traits</classname> instantiation </para></description><type>Ptr</type></typedef>
3592<typedef name="element_type"><description><para>Ptr::element_type if such a type exists; otherwise, T if Ptr is a class template instantiation of the form SomePointer&lt;T, Args&gt;, where Args is zero or more type arguments ; otherwise , the specialization is ill-formed. </para></description><type>unspecified_type</type></typedef>
3593<typedef name="difference_type"><description><para>Ptr::difference_type if such a type exists; otherwise, std::ptrdiff_t. </para></description><type>unspecified_type</type></typedef>
3594<typedef name="rebind"><description><para>Ptr::rebind&lt;U&gt; if such a type exists; otherwise, SomePointer&lt;U, Args&gt; if Ptr is a class template instantiation of the form SomePointer&lt;T, Args&gt;, where Args is zero or more type arguments ; otherwise, the instantiation of rebind is ill-formed.</para><para>For portable code for C++03 and C++11, <programlisting>typename rebind_pointer&lt;U&gt;::type</programlisting> shall be used instead of rebind<underline> to obtain a pointer to U. </underline></para></description><type>unspecified</type></typedef>
3595<typedef name="reference"><description><para>Ptr::reference if such a type exists (non-standard extension); otherwise, element_type &amp; </para></description><type>unspecified_type</type></typedef>
3596<method-group name="public static functions">
3597<method name="pointer_to" specifiers="static"><type>pointer</type><parameter name="r"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Remark</emphasis>: If element_type is (possibly cv-qualified) void, r type is unspecified; otherwise, it is element_type &amp;.</para><para><emphasis role="bold">Returns</emphasis>: A dereferenceable pointer to r obtained by calling Ptr::pointer_to(reference). Non-standard extension: If such function does not exist, returns pointer(addressof(r));</para><para><emphasis role="bold">Note</emphasis>: For non-conforming compilers only the existence of a member function called <computeroutput>pointer_to</computeroutput> is checked. </para></description></method>
3598<method name="static_cast_from" specifiers="static"><type>pointer</type><template>
3599          <template-type-parameter name="UPtr"/>
3600        </template><parameter name="uptr"><paramtype>const UPtr &amp;</paramtype></parameter><description><para><emphasis role="bold">Remark</emphasis>: Non-standard extension.</para><para><emphasis role="bold">Returns</emphasis>: A dereferenceable pointer to r obtained by calling the static template function Ptr::static_cast_from(UPpr/const UPpr &amp;). If such function does not exist, returns pointer_to(static_cast&lt;element_type&amp;&gt;(*uptr))</para><para><emphasis role="bold">Note</emphasis>: For non-conforming compilers only the existence of a member function called <computeroutput>static_cast_from</computeroutput> is checked. </para></description></method>
3601<method name="const_cast_from" specifiers="static"><type>pointer</type><template>
3602          <template-type-parameter name="UPtr"/>
3603        </template><parameter name="uptr"><paramtype>const UPtr &amp;</paramtype></parameter><description><para><emphasis role="bold">Remark</emphasis>: Non-standard extension.</para><para><emphasis role="bold">Returns</emphasis>: A dereferenceable pointer to r obtained by calling the static template function Ptr::const_cast_from&lt;UPtr&gt;(UPpr/const UPpr &amp;). If such function does not exist, returns pointer_to(const_cast&lt;element_type&amp;&gt;(*uptr))</para><para><emphasis role="bold">Note</emphasis>: For non-conforming compilers only the existence of a member function called <computeroutput>const_cast_from</computeroutput> is checked. </para></description></method>
3604<method name="dynamic_cast_from" specifiers="static"><type>pointer</type><template>
3605          <template-type-parameter name="UPtr"/>
3606        </template><parameter name="uptr"><paramtype>const UPtr &amp;</paramtype></parameter><description><para><emphasis role="bold">Remark</emphasis>: Non-standard extension.</para><para><emphasis role="bold">Returns</emphasis>: A dereferenceable pointer to r obtained by calling the static template function Ptr::dynamic_cast_from&lt;UPtr&gt;(UPpr/const UPpr &amp;). If such function does not exist, returns pointer_to(<emphasis>dynamic_cast&lt;element_type</emphasis>&gt;(&amp;*uptr))</para><para><emphasis role="bold">Note</emphasis>: For non-conforming compilers only the existence of a member function called <computeroutput>dynamic_cast_from</computeroutput> is checked. </para></description></method>
3607</method-group>
3608</struct><struct-specialization name="pointer_traits"><template>
3609      <template-type-parameter name="T"/>
3610    </template><specialization><template-arg>T *</template-arg></specialization><description><para>Specialization of <classname alt="boost::intrusive::pointer_traits">pointer_traits</classname> for raw pointers </para></description><struct name="rebind_pointer"><template>
3611      <template-type-parameter name="U"/>
3612    </template><typedef name="type"><type>U *</type></typedef>
3613</struct><typedef name="element_type"><type>T</type></typedef>
3614<typedef name="pointer"><type>T *</type></typedef>
3615<typedef name="difference_type"><type>std::ptrdiff_t</type></typedef>
3616<typedef name="reference"><type>T &amp;</type></typedef>
3617<typedef name="rebind"><description><programlisting>U *</programlisting><para>For portable code for C++03 and C++11, <programlisting>typename rebind_pointer&lt;U&gt;::type</programlisting> shall be used instead of rebind<underline> to obtain a pointer to U. </underline></para></description><type>U *</type></typedef>
3618<method-group name="public static functions">
3619<method name="pointer_to" specifiers="static"><type>pointer</type><parameter name="r"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: addressof(r) </para></description></method>
3620<method name="static_cast_from" specifiers="static"><type>pointer</type><template>
3621          <template-type-parameter name="U"/>
3622        </template><parameter name="uptr"><paramtype>U *</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: static_cast&lt;pointer&gt;(uptr) </para></description></method>
3623<method name="const_cast_from" specifiers="static"><type>pointer</type><template>
3624          <template-type-parameter name="U"/>
3625        </template><parameter name="uptr"><paramtype>U *</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: const_cast&lt;pointer&gt;(uptr) </para></description></method>
3626<method name="dynamic_cast_from" specifiers="static"><type>pointer</type><template>
3627          <template-type-parameter name="U"/>
3628        </template><parameter name="uptr"><paramtype>U *</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: dynamic_cast&lt;pointer&gt;(uptr) </para></description></method>
3629</method-group>
3630</struct-specialization>
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682</namespace>
3683</namespace>
3684</header>
3685<header name="boost/intrusive/priority_compare.hpp">
3686<namespace name="boost">
3687<namespace name="intrusive">
3688<struct name="priority_compare"><template>
3689      <template-type-parameter name="T"><default>void</default></template-type-parameter>
3690    </template><typedef name="first_argument_type"><type>T</type></typedef>
3691<typedef name="second_argument_type"><type>T</type></typedef>
3692<typedef name="result_type"><type>bool</type></typedef>
3693<method-group name="public member functions">
3694<method name="operator()" cv="const"><type>bool</type><parameter name="val"><paramtype>const T &amp;</paramtype></parameter><parameter name="val2"><paramtype>const T &amp;</paramtype></parameter></method>
3695</method-group>
3696</struct><struct-specialization name="priority_compare"><template>
3697    </template><specialization><template-arg>void</template-arg></specialization><method-group name="public member functions">
3698<method name="operator()" cv="const"><type>bool</type><template>
3699          <template-type-parameter name="T"/>
3700          <template-type-parameter name="U"/>
3701        </template><parameter name="t"><paramtype>const T &amp;</paramtype></parameter><parameter name="u"><paramtype>const U &amp;</paramtype></parameter></method>
3702</method-group>
3703</struct-specialization>
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755</namespace>
3756</namespace>
3757</header>
3758<header name="boost/intrusive/rbtree.hpp">
3759<namespace name="boost">
3760<namespace name="intrusive">
3761<struct name="make_rbtree"><template>
3762      <template-type-parameter name="T"/>
3763      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
3764    </template><description><para>Helper metafunction to define a <computeroutput>rbtree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
3765</struct><class name="rbtree"><template>
3766      <template-type-parameter name="T"/>
3767      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
3768    </template><description><para>The class template rbtree is an intrusive red-black tree container, that is used to construct intrusive set and multiset containers. The no-throw guarantee holds only, if the key_compare object doesn't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
3769<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
3770<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
3771<typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
3772<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
3773<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
3774<typedef name="reference"><type>implementation_defined::reference</type></typedef>
3775<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
3776<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
3777<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
3778<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
3779<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
3780<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
3781<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
3782<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
3783<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
3784<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
3785<typedef name="node"><type>implementation_defined::node</type></typedef>
3786<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
3787<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
3788<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
3789<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
3790<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
3791<method-group name="public member functions">
3792<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3793<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3794<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3795<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3796<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3797<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3798<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3799<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3800<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3801<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3802<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3803<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3804<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3805<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3806<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3807<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
3808<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
3809<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3810<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3811<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>rbtree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
3812<method name="clone_from"><type>void</type><template>
3813          <template-type-parameter name="Cloner"/>
3814          <template-type-parameter name="Disposer"/>
3815        </template><parameter name="src"><paramtype>const <classname>rbtree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
3816<method name="clone_from"><type>void</type><template>
3817          <template-type-parameter name="Cloner"/>
3818          <template-type-parameter name="Disposer"/>
3819        </template><parameter name="src"><paramtype><classname>rbtree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
3820<method name="clone_from"><type>void</type><template>
3821          <template-type-parameter name="Cloner"/>
3822          <template-type-parameter name="Disposer"/>
3823        </template><parameter name="src"><paramtype><classname>rbtree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
3824<method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
3825<method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
3826<method name="insert_equal"><type>void</type><template>
3827          <template-type-parameter name="Iterator"/>
3828        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
3829<method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
3830<method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
3831<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
3832          <template-type-parameter name="KeyType"/>
3833          <template-type-parameter name="KeyTypeKeyCompare"/>
3834        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
3835<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
3836          <template-type-parameter name="KeyType"/>
3837          <template-type-parameter name="KeyTypeKeyCompare"/>
3838        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
3839<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
3840<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
3841<method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
3842<method name="insert_unique"><type>void</type><template>
3843          <template-type-parameter name="Iterator"/>
3844        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
3845<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
3846<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
3847<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
3848<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
3849<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
3850<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
3851<method name="erase"><type>size_type</type><template>
3852          <template-type-parameter name="KeyType"/>
3853          <template-type-parameter name="KeyTypeKeyCompare"/>
3854        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
3855<method name="erase_and_dispose"><type>iterator</type><template>
3856          <template-type-parameter name="Disposer"/>
3857        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
3858<method name="erase_and_dispose"><type>iterator</type><template>
3859          <template-type-parameter name="Disposer"/>
3860        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
3861<method name="erase_and_dispose"><type>size_type</type><template>
3862          <template-type-parameter name="Disposer"/>
3863        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
3864<method name="erase_and_dispose"><type>size_type</type><template>
3865          <template-type-parameter name="KeyType"/>
3866          <template-type-parameter name="KeyTypeKeyCompare"/>
3867          <template-type-parameter name="Disposer"/>
3868        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
3869<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
3870<method name="clear_and_dispose"><type>void</type><template>
3871          <template-type-parameter name="Disposer"/>
3872        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
3873<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3874<method name="count" cv="const"><type>size_type</type><template>
3875          <template-type-parameter name="KeyType"/>
3876          <template-type-parameter name="KeyTypeKeyCompare"/>
3877        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
3878<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3879<method name="lower_bound"><type>iterator</type><template>
3880          <template-type-parameter name="KeyType"/>
3881          <template-type-parameter name="KeyTypeKeyCompare"/>
3882        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3883<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3884<method name="lower_bound" cv="const"><type>const_iterator</type><template>
3885          <template-type-parameter name="KeyType"/>
3886          <template-type-parameter name="KeyTypeKeyCompare"/>
3887        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3888<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3889<method name="upper_bound"><type>iterator</type><template>
3890          <template-type-parameter name="KeyType"/>
3891          <template-type-parameter name="KeyTypeKeyCompare"/>
3892        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
3893<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3894<method name="upper_bound" cv="const"><type>const_iterator</type><template>
3895          <template-type-parameter name="KeyType"/>
3896          <template-type-parameter name="KeyTypeKeyCompare"/>
3897        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
3898<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3899<method name="find"><type>iterator</type><template>
3900          <template-type-parameter name="KeyType"/>
3901          <template-type-parameter name="KeyTypeKeyCompare"/>
3902        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
3903<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3904<method name="find" cv="const"><type>const_iterator</type><template>
3905          <template-type-parameter name="KeyType"/>
3906          <template-type-parameter name="KeyTypeKeyCompare"/>
3907        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
3908<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3909<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
3910          <template-type-parameter name="KeyType"/>
3911          <template-type-parameter name="KeyTypeKeyCompare"/>
3912        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
3913<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
3914<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
3915          <template-type-parameter name="KeyType"/>
3916          <template-type-parameter name="KeyTypeKeyCompare"/>
3917        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
3918<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
3919<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
3920          <template-type-parameter name="KeyType"/>
3921          <template-type-parameter name="KeyTypeKeyCompare"/>
3922        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
3923<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
3924<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
3925          <template-type-parameter name="KeyType"/>
3926          <template-type-parameter name="KeyTypeKeyCompare"/>
3927        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
3928<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3929<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
3930<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
3931<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
3932<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
3933<method name="merge_unique"><type>void</type><template>
3934          <template-type-parameter name="T"/>
3935          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
3936        </template><parameter name=""><paramtype><classname>rbtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
3937<method name="merge_equal"><type>void</type><template>
3938          <template-type-parameter name="T"/>
3939          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
3940        </template><parameter name=""><paramtype><classname>rbtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
3941</method-group>
3942<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
3943<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
3944<constructor><template>
3945          <template-type-parameter name="Iterator"/>
3946        </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
3947<constructor><parameter name="x"><paramtype><classname>rbtree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
3948<copy-assignment><type><classname>rbtree</classname> &amp;</type><parameter name="x"><paramtype><classname>rbtree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
3949<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
3950<method-group name="public static functions">
3951<method name="container_from_end_iterator" specifiers="static"><type><classname>rbtree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
3952<method name="container_from_end_iterator" specifiers="static"><type>const <classname>rbtree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
3953<method name="container_from_iterator" specifiers="static"><type><classname>rbtree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
3954<method name="container_from_iterator" specifiers="static"><type>const <classname>rbtree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
3955<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
3956<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
3957<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
3958</method-group>
3959</class>
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011</namespace>
4012</namespace>
4013</header>
4014<header name="boost/intrusive/rbtree_algorithms.hpp">
4015<namespace name="boost">
4016<namespace name="intrusive">
4017<class name="rbtree_algorithms"><template>
4018      <template-type-parameter name="NodeTraits"/>
4019    </template><description><para><classname alt="boost::intrusive::rbtree_algorithms">rbtree_algorithms</classname> provides basic algorithms to manipulate nodes forming a red-black tree. The insertion and deletion algorithms are based on those in Cormen, Leiserson, and Rivest, Introduction to Algorithms (MIT Press, 1990), except that</para><para>(1) the header node is maintained with links not only to the root but also to the leftmost node of the tree, to enable constant time begin(), and to the rightmost node of the tree, to enable linear time performance when used with the generic set algorithms (set_union, etc.);</para><para>(2) when a node being deleted has two children its successor node is relinked into its place, rather than copied, so that the only pointers invalidated are those referring to the deleted node.</para><para><classname alt="boost::intrusive::rbtree_algorithms">rbtree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><computeroutput>color</computeroutput>: The type that can store the color of a node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput></para><para><computeroutput>static color get_color(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_color(node_ptr n, color c);</computeroutput></para><para><computeroutput>static color black();</computeroutput></para><para><computeroutput>static color red();</computeroutput> </para></description><typedef name="node_traits"><type>NodeTraits</type></typedef>
4020<typedef name="node"><type>NodeTraits::node</type></typedef>
4021<typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
4022<typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
4023<typedef name="color"><type>NodeTraits::color</type></typedef>
4024<typedef name="insert_commit_data"><description><para>This type is the information that will be filled by insert_unique_check </para></description><type>bstree_algo::insert_commit_data</type></typedef>
4025<method-group name="public static functions">
4026<method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4027<method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4028<method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4029<method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4030<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
4031<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
4032<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
4033<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
4034<method name="unlink" specifiers="static"><type>void</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4035<method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
4036<method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4037<method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4038<method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4039<method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4040<method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
4041<method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
4042<method name="erase" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4043<method name="transfer_unique" specifiers="static"><type>bool</type><template>
4044          <template-type-parameter name="NodePtrCompare"/>
4045        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
4046<method name="transfer_equal" specifiers="static"><type>void</type><template>
4047          <template-type-parameter name="NodePtrCompare"/>
4048        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
4049<method name="clone" specifiers="static"><type>void</type><template>
4050          <template-type-parameter name="Cloner"/>
4051          <template-type-parameter name="Disposer"/>
4052        </template><parameter name="source_header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
4053<method name="clear_and_dispose" specifiers="static"><type>void</type><template>
4054          <template-type-parameter name="Disposer"/>
4055        </template><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
4056<method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
4057          <template-type-parameter name="KeyType"/>
4058          <template-type-parameter name="KeyNodePtrCompare"/>
4059        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
4060<method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
4061          <template-type-parameter name="KeyType"/>
4062          <template-type-parameter name="KeyNodePtrCompare"/>
4063        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
4064<method name="find" specifiers="static"><type>node_ptr</type><template>
4065          <template-type-parameter name="KeyType"/>
4066          <template-type-parameter name="KeyNodePtrCompare"/>
4067        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
4068<method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
4069          <template-type-parameter name="KeyType"/>
4070          <template-type-parameter name="KeyNodePtrCompare"/>
4071        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
4072<method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
4073          <template-type-parameter name="KeyType"/>
4074          <template-type-parameter name="KeyNodePtrCompare"/>
4075        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
4076<method name="count" specifiers="static"><type>std::size_t</type><template>
4077          <template-type-parameter name="KeyType"/>
4078          <template-type-parameter name="KeyNodePtrCompare"/>
4079        </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
4080<method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
4081          <template-type-parameter name="NodePtrCompare"/>
4082        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
4083<method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
4084          <template-type-parameter name="NodePtrCompare"/>
4085        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
4086<method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
4087          <template-type-parameter name="NodePtrCompare"/>
4088        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
4089<method name="insert_before" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
4090<method name="push_back" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
4091<method name="push_front" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
4092<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
4093          <template-type-parameter name="KeyType"/>
4094          <template-type-parameter name="KeyNodePtrCompare"/>
4095        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
4096<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
4097          <template-type-parameter name="KeyType"/>
4098          <template-type-parameter name="KeyNodePtrCompare"/>
4099        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
4100<method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
4101<method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4102</method-group>
4103</class>
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155</namespace>
4156</namespace>
4157</header>
4158<header name="boost/intrusive/set.hpp">
4159<namespace name="boost">
4160<namespace name="intrusive">
4161<struct name="make_multiset"><template>
4162      <template-type-parameter name="T"/>
4163      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4164    </template><description><para>Helper metafunction to define a <computeroutput>multiset</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
4165</struct><struct name="make_set"><template>
4166      <template-type-parameter name="T"/>
4167      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4168    </template><description><para>Helper metafunction to define a <computeroutput>set</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
4169</struct><class name="multiset"><template>
4170      <template-type-parameter name="T"/>
4171      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4172    </template><description><para>The class template multiset is an intrusive container, that mimics most of the interface of std::multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
4173<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
4174<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
4175<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
4176<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
4177<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
4178<typedef name="reference"><type>implementation_defined::reference</type></typedef>
4179<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
4180<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
4181<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
4182<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
4183<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
4184<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
4185<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
4186<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
4187<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
4188<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
4189<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
4190<typedef name="node"><type>implementation_defined::node</type></typedef>
4191<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
4192<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
4193<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
4194<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
4195<method-group name="public member functions">
4196<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4197<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4198<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4199<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4200<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4201<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4202<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4203<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4204<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4205<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4206<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4207<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4208<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4209<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4210<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4211<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
4212<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
4213<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4214<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4215<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
4216<method name="clone_from"><type>void</type><template>
4217          <template-type-parameter name="Cloner"/>
4218          <template-type-parameter name="Disposer"/>
4219        </template><parameter name="src"><paramtype>const <classname>multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
4220<method name="clone_from"><type>void</type><template>
4221          <template-type-parameter name="Cloner"/>
4222          <template-type-parameter name="Disposer"/>
4223        </template><parameter name="src"><paramtype><classname>multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
4224<method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4225<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4226<method name="insert"><type>void</type><template>
4227          <template-type-parameter name="Iterator"/>
4228        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4229<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4230<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4231<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4232<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4233<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4234<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4235<method name="erase"><type>size_type</type><template>
4236          <template-type-parameter name="KeyType"/>
4237          <template-type-parameter name="KeyTypeKeyCompare"/>
4238        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4239<method name="erase_and_dispose"><type>iterator</type><template>
4240          <template-type-parameter name="Disposer"/>
4241        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4242<method name="erase_and_dispose"><type>iterator</type><template>
4243          <template-type-parameter name="Disposer"/>
4244        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4245<method name="erase_and_dispose"><type>size_type</type><template>
4246          <template-type-parameter name="Disposer"/>
4247        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4248<method name="erase_and_dispose"><type>size_type</type><template>
4249          <template-type-parameter name="KeyType"/>
4250          <template-type-parameter name="KeyTypeKeyCompare"/>
4251          <template-type-parameter name="Disposer"/>
4252        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4253<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4254<method name="clear_and_dispose"><type>void</type><template>
4255          <template-type-parameter name="Disposer"/>
4256        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
4257<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4258<method name="count" cv="const"><type>size_type</type><template>
4259          <template-type-parameter name="KeyType"/>
4260          <template-type-parameter name="KeyTypeKeyCompare"/>
4261        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4262<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4263<method name="lower_bound"><type>iterator</type><template>
4264          <template-type-parameter name="KeyType"/>
4265          <template-type-parameter name="KeyTypeKeyCompare"/>
4266        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4267<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4268<method name="lower_bound" cv="const"><type>const_iterator</type><template>
4269          <template-type-parameter name="KeyType"/>
4270          <template-type-parameter name="KeyTypeKeyCompare"/>
4271        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4272<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4273<method name="upper_bound"><type>iterator</type><template>
4274          <template-type-parameter name="KeyType"/>
4275          <template-type-parameter name="KeyTypeKeyCompare"/>
4276        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4277<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4278<method name="upper_bound" cv="const"><type>const_iterator</type><template>
4279          <template-type-parameter name="KeyType"/>
4280          <template-type-parameter name="KeyTypeKeyCompare"/>
4281        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4282<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4283<method name="find"><type>iterator</type><template>
4284          <template-type-parameter name="KeyType"/>
4285          <template-type-parameter name="KeyTypeKeyCompare"/>
4286        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4287<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4288<method name="find" cv="const"><type>const_iterator</type><template>
4289          <template-type-parameter name="KeyType"/>
4290          <template-type-parameter name="KeyTypeKeyCompare"/>
4291        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4292<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4293<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
4294          <template-type-parameter name="KeyType"/>
4295          <template-type-parameter name="KeyTypeKeyCompare"/>
4296        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4297<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4298<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
4299          <template-type-parameter name="KeyType"/>
4300          <template-type-parameter name="KeyTypeKeyCompare"/>
4301        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4302<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4303<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
4304          <template-type-parameter name="KeyType"/>
4305          <template-type-parameter name="KeyTypeKeyCompare"/>
4306        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4307<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4308<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
4309          <template-type-parameter name="KeyType"/>
4310          <template-type-parameter name="KeyTypeKeyCompare"/>
4311        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4312<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4313<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4314<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
4315<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
4316<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
4317<method name="merge"><type>void</type><template>
4318          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
4319        </template><parameter name="source"><paramtype><classname>multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
4320<method name="merge"><type>void</type><template>
4321          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
4322        </template><parameter name="source"><paramtype><classname>set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
4323</method-group>
4324<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
4325<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
4326<constructor><template>
4327          <template-type-parameter name="Iterator"/>
4328        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
4329<constructor><parameter name="x"><paramtype><classname>multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
4330<copy-assignment><type><classname>multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
4331<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
4332<method-group name="public static functions">
4333<method name="container_from_end_iterator" specifiers="static"><type><classname>multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
4334<method name="container_from_end_iterator" specifiers="static"><type>const <classname>multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
4335<method name="container_from_iterator" specifiers="static"><type><classname>multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
4336<method name="container_from_iterator" specifiers="static"><type>const <classname>multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
4337<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
4338<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
4339<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
4340</method-group>
4341</class><class name="set"><template>
4342      <template-type-parameter name="T"/>
4343      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4344    </template><description><para>The class template set is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
4345<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
4346<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
4347<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
4348<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
4349<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
4350<typedef name="reference"><type>implementation_defined::reference</type></typedef>
4351<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
4352<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
4353<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
4354<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
4355<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
4356<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
4357<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
4358<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
4359<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
4360<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
4361<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
4362<typedef name="node"><type>implementation_defined::node</type></typedef>
4363<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
4364<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
4365<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
4366<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
4367<method-group name="public member functions">
4368<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4369<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4370<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4371<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4372<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4373<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4374<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4375<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4376<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4377<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4378<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4379<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4380<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4381<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4382<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4383<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
4384<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
4385<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4386<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4387<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
4388<method name="clone_from"><type>void</type><template>
4389          <template-type-parameter name="Cloner"/>
4390          <template-type-parameter name="Disposer"/>
4391        </template><parameter name="src"><paramtype>const <classname>set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
4392<method name="clone_from"><type>void</type><template>
4393          <template-type-parameter name="Cloner"/>
4394          <template-type-parameter name="Disposer"/>
4395        </template><parameter name="src"><paramtype><classname>set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
4396<method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4397<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4398<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
4399<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
4400<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
4401          <template-type-parameter name="KeyType"/>
4402          <template-type-parameter name="KeyTypeKeyCompare"/>
4403        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
4404<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
4405          <template-type-parameter name="KeyType"/>
4406          <template-type-parameter name="KeyTypeKeyCompare"/>
4407        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
4408<method name="insert"><type>void</type><template>
4409          <template-type-parameter name="Iterator"/>
4410        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4411<method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
4412<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4413<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4414<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4415<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4416<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4417<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4418<method name="erase"><type>size_type</type><template>
4419          <template-type-parameter name="KeyType"/>
4420          <template-type-parameter name="KeyTypeKeyCompare"/>
4421        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4422<method name="erase_and_dispose"><type>iterator</type><template>
4423          <template-type-parameter name="Disposer"/>
4424        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4425<method name="erase_and_dispose"><type>iterator</type><template>
4426          <template-type-parameter name="Disposer"/>
4427        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4428<method name="erase_and_dispose"><type>size_type</type><template>
4429          <template-type-parameter name="Disposer"/>
4430        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4431<method name="erase_and_dispose"><type>size_type</type><template>
4432          <template-type-parameter name="KeyType"/>
4433          <template-type-parameter name="KeyTypeKeyCompare"/>
4434          <template-type-parameter name="Disposer"/>
4435        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4436<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4437<method name="clear_and_dispose"><type>void</type><template>
4438          <template-type-parameter name="Disposer"/>
4439        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
4440<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4441<method name="count" cv="const"><type>size_type</type><template>
4442          <template-type-parameter name="KeyType"/>
4443          <template-type-parameter name="KeyTypeKeyCompare"/>
4444        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4445<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4446<method name="lower_bound"><type>iterator</type><template>
4447          <template-type-parameter name="KeyType"/>
4448          <template-type-parameter name="KeyTypeKeyCompare"/>
4449        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4450<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4451<method name="lower_bound" cv="const"><type>const_iterator</type><template>
4452          <template-type-parameter name="KeyType"/>
4453          <template-type-parameter name="KeyTypeKeyCompare"/>
4454        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4455<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4456<method name="upper_bound"><type>iterator</type><template>
4457          <template-type-parameter name="KeyType"/>
4458          <template-type-parameter name="KeyTypeKeyCompare"/>
4459        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4460<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4461<method name="upper_bound" cv="const"><type>const_iterator</type><template>
4462          <template-type-parameter name="KeyType"/>
4463          <template-type-parameter name="KeyTypeKeyCompare"/>
4464        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4465<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4466<method name="find"><type>iterator</type><template>
4467          <template-type-parameter name="KeyType"/>
4468          <template-type-parameter name="KeyTypeKeyCompare"/>
4469        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4470<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4471<method name="find" cv="const"><type>const_iterator</type><template>
4472          <template-type-parameter name="KeyType"/>
4473          <template-type-parameter name="KeyTypeKeyCompare"/>
4474        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4475<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4476<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
4477          <template-type-parameter name="KeyType"/>
4478          <template-type-parameter name="KeyTypeKeyCompare"/>
4479        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4480<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4481<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
4482          <template-type-parameter name="KeyType"/>
4483          <template-type-parameter name="KeyTypeKeyCompare"/>
4484        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4485<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4486<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
4487          <template-type-parameter name="KeyType"/>
4488          <template-type-parameter name="KeyTypeKeyCompare"/>
4489        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4490<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4491<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
4492          <template-type-parameter name="KeyType"/>
4493          <template-type-parameter name="KeyTypeKeyCompare"/>
4494        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4495<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4496<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4497<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
4498<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
4499<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
4500<method name="merge"><type>void</type><template>
4501          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
4502        </template><parameter name="source"><paramtype><classname>set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
4503<method name="merge"><type>void</type><template>
4504          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
4505        </template><parameter name="source"><paramtype><classname>multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
4506</method-group>
4507<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
4508<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
4509<constructor><template>
4510          <template-type-parameter name="Iterator"/>
4511        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
4512<constructor><parameter name="x"><paramtype><classname>set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
4513<copy-assignment><type><classname>set</classname> &amp;</type><parameter name="x"><paramtype><classname>set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
4514<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
4515<method-group name="public static functions">
4516<method name="container_from_end_iterator" specifiers="static"><type><classname>set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
4517<method name="container_from_end_iterator" specifiers="static"><type>const <classname>set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
4518<method name="container_from_iterator" specifiers="static"><type><classname>set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
4519<method name="container_from_iterator" specifiers="static"><type>const <classname>set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
4520<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
4521<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
4522<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
4523</method-group>
4524</class>
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544<function name="operator!="><type>bool</type><template>
4545          <template-type-parameter name="T"/>
4546          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4547        </template><parameter name="x"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4548<function name="operator&gt;"><type>bool</type><template>
4549          <template-type-parameter name="T"/>
4550          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4551        </template><parameter name="x"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4552<function name="operator&lt;="><type>bool</type><template>
4553          <template-type-parameter name="T"/>
4554          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4555        </template><parameter name="x"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4556<function name="operator&gt;="><type>bool</type><template>
4557          <template-type-parameter name="T"/>
4558          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4559        </template><parameter name="x"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4560<function name="swap"><type>void</type><template>
4561          <template-type-parameter name="T"/>
4562          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4563        </template><parameter name="x"><paramtype><classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4564<function name="operator!="><type>bool</type><template>
4565          <template-type-parameter name="T"/>
4566          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4567        </template><parameter name="x"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4568<function name="operator&gt;"><type>bool</type><template>
4569          <template-type-parameter name="T"/>
4570          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4571        </template><parameter name="x"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4572<function name="operator&lt;="><type>bool</type><template>
4573          <template-type-parameter name="T"/>
4574          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4575        </template><parameter name="x"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4576<function name="operator&gt;="><type>bool</type><template>
4577          <template-type-parameter name="T"/>
4578          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4579        </template><parameter name="x"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4580<function name="swap"><type>void</type><template>
4581          <template-type-parameter name="T"/>
4582          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4583        </template><parameter name="x"><paramtype><classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606</namespace>
4607</namespace>
4608</header>
4609<header name="boost/intrusive/set_hook.hpp">
4610<namespace name="boost">
4611<namespace name="intrusive">
4612<struct name="make_set_base_hook"><template>
4613      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4614    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::set_base_hook">set_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
4615</struct><struct name="make_set_member_hook"><template>
4616      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4617    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::set_member_hook">set_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
4618</struct><class name="set_base_hook"><template>
4619      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4620    </template><inherit access="public">make_set_base_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::set_base_hook">set_base_hook</classname> in order to store objects in in a set/multiset. <classname alt="boost::intrusive::set_base_hook">set_base_hook</classname> holds the data necessary to maintain the set/multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for set/multiset.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>optimize_size&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>optimize_size&lt;&gt;</computeroutput> will tell the hook to optimize the hook for size instead of speed. </para></description><method-group name="public member functions">
4621<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4622<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
4623<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4624</method-group>
4625<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
4626<constructor><parameter name=""><paramtype>const <classname>set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
4627<copy-assignment><type><classname>set_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
4628<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
4629</class><class name="set_member_hook"><template>
4630      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4631    </template><inherit access="public">make_set_member_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::set_member_hook">set_member_hook</classname> in order to store objects of this class in a set/multiset. <classname alt="boost::intrusive::set_member_hook">set_member_hook</classname> holds the data necessary for maintaining the set/multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for set/multiset.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>optimize_size&lt;&gt;</computeroutput>.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>optimize_size&lt;&gt;</computeroutput> will tell the hook to optimize the hook for size instead of speed. </para></description><method-group name="public member functions">
4632<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4633<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
4634<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4635</method-group>
4636<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
4637<constructor><parameter name=""><paramtype>const <classname>set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
4638<copy-assignment><type><classname>set_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
4639<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
4640</class>
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692</namespace>
4693</namespace>
4694</header>
4695<header name="boost/intrusive/sg_set.hpp">
4696<namespace name="boost">
4697<namespace name="intrusive">
4698<struct name="make_sg_multiset"><template>
4699      <template-type-parameter name="T"/>
4700      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4701    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::sg_multiset">sg_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
4702</struct><struct name="make_sg_set"><template>
4703      <template-type-parameter name="T"/>
4704      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4705    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::sg_set">sg_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
4706</struct><class name="sg_multiset"><template>
4707      <template-type-parameter name="T"/>
4708      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4709    </template><description><para>The class template <classname alt="boost::intrusive::sg_multiset">sg_multiset</classname> is an intrusive container, that mimics most of the interface of std::sg_multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>floating_point&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
4710<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
4711<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
4712<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
4713<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
4714<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
4715<typedef name="reference"><type>implementation_defined::reference</type></typedef>
4716<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
4717<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
4718<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
4719<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
4720<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
4721<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
4722<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
4723<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
4724<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
4725<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
4726<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
4727<typedef name="node"><type>implementation_defined::node</type></typedef>
4728<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
4729<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
4730<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
4731<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
4732<method-group name="public member functions">
4733<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4734<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4735<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4736<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4737<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4738<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4739<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4740<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4741<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4742<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4743<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4744<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4745<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4746<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4747<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4748<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
4749<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
4750<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4751<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4752<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>sg_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
4753<method name="clone_from"><type>void</type><template>
4754          <template-type-parameter name="Cloner"/>
4755          <template-type-parameter name="Disposer"/>
4756        </template><parameter name="src"><paramtype>const <classname>sg_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
4757<method name="clone_from"><type>void</type><template>
4758          <template-type-parameter name="Cloner"/>
4759          <template-type-parameter name="Disposer"/>
4760        </template><parameter name="src"><paramtype><classname>sg_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
4761<method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4762<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4763<method name="insert"><type>void</type><template>
4764          <template-type-parameter name="Iterator"/>
4765        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4766<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4767<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4768<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4769<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4770<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4771<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4772<method name="erase"><type>size_type</type><template>
4773          <template-type-parameter name="KeyType"/>
4774          <template-type-parameter name="KeyTypeKeyCompare"/>
4775        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4776<method name="erase_and_dispose"><type>iterator</type><template>
4777          <template-type-parameter name="Disposer"/>
4778        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4779<method name="erase_and_dispose"><type>iterator</type><template>
4780          <template-type-parameter name="Disposer"/>
4781        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4782<method name="erase_and_dispose"><type>size_type</type><template>
4783          <template-type-parameter name="Disposer"/>
4784        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4785<method name="erase_and_dispose"><type>size_type</type><template>
4786          <template-type-parameter name="KeyType"/>
4787          <template-type-parameter name="KeyTypeKeyCompare"/>
4788          <template-type-parameter name="Disposer"/>
4789        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4790<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4791<method name="clear_and_dispose"><type>void</type><template>
4792          <template-type-parameter name="Disposer"/>
4793        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
4794<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4795<method name="count" cv="const"><type>size_type</type><template>
4796          <template-type-parameter name="KeyType"/>
4797          <template-type-parameter name="KeyTypeKeyCompare"/>
4798        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4799<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4800<method name="lower_bound"><type>iterator</type><template>
4801          <template-type-parameter name="KeyType"/>
4802          <template-type-parameter name="KeyTypeKeyCompare"/>
4803        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4804<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4805<method name="lower_bound" cv="const"><type>const_iterator</type><template>
4806          <template-type-parameter name="KeyType"/>
4807          <template-type-parameter name="KeyTypeKeyCompare"/>
4808        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4809<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4810<method name="upper_bound"><type>iterator</type><template>
4811          <template-type-parameter name="KeyType"/>
4812          <template-type-parameter name="KeyTypeKeyCompare"/>
4813        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4814<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4815<method name="upper_bound" cv="const"><type>const_iterator</type><template>
4816          <template-type-parameter name="KeyType"/>
4817          <template-type-parameter name="KeyTypeKeyCompare"/>
4818        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4819<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4820<method name="find"><type>iterator</type><template>
4821          <template-type-parameter name="KeyType"/>
4822          <template-type-parameter name="KeyTypeKeyCompare"/>
4823        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4824<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4825<method name="find" cv="const"><type>const_iterator</type><template>
4826          <template-type-parameter name="KeyType"/>
4827          <template-type-parameter name="KeyTypeKeyCompare"/>
4828        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4829<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4830<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
4831          <template-type-parameter name="KeyType"/>
4832          <template-type-parameter name="KeyTypeKeyCompare"/>
4833        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4834<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4835<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
4836          <template-type-parameter name="KeyType"/>
4837          <template-type-parameter name="KeyTypeKeyCompare"/>
4838        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4839<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4840<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
4841          <template-type-parameter name="KeyType"/>
4842          <template-type-parameter name="KeyTypeKeyCompare"/>
4843        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4844<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4845<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
4846          <template-type-parameter name="KeyType"/>
4847          <template-type-parameter name="KeyTypeKeyCompare"/>
4848        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
4849<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4850<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4851<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
4852<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
4853<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
4854<method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
4855<method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
4856<method name="balance_factor" cv="const"><type>float</type><description><para><emphasis role="bold">Returns</emphasis>: The balance factor (alpha) used in this tree</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
4857<method name="balance_factor"><type>void</type><parameter name="new_alpha"><paramtype>float</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_alpha must be a value between 0.5 and 1.0</para><para><emphasis role="bold">Effects</emphasis>: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
4858<method name="merge"><type>void</type><template>
4859          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
4860        </template><parameter name="source"><paramtype><classname>sg_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
4861<method name="merge"><type>void</type><template>
4862          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
4863        </template><parameter name="source"><paramtype><classname>sg_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
4864</method-group>
4865<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
4866<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
4867<constructor><template>
4868          <template-type-parameter name="Iterator"/>
4869        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
4870<constructor><parameter name="x"><paramtype><classname>sg_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
4871<copy-assignment><type><classname>sg_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>sg_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
4872<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
4873<method-group name="public static functions">
4874<method name="container_from_end_iterator" specifiers="static"><type><classname>sg_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
4875<method name="container_from_end_iterator" specifiers="static"><type>const <classname>sg_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
4876<method name="container_from_iterator" specifiers="static"><type><classname>sg_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
4877<method name="container_from_iterator" specifiers="static"><type>const <classname>sg_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
4878<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
4879<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
4880<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
4881</method-group>
4882</class><class name="sg_set"><template>
4883      <template-type-parameter name="T"/>
4884      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
4885    </template><description><para>The class template <classname alt="boost::intrusive::sg_set">sg_set</classname> is an intrusive container, that mimics most of the interface of std::sg_set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>floating_point&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
4886<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
4887<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
4888<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
4889<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
4890<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
4891<typedef name="reference"><type>implementation_defined::reference</type></typedef>
4892<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
4893<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
4894<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
4895<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
4896<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
4897<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
4898<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
4899<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
4900<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
4901<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
4902<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
4903<typedef name="node"><type>implementation_defined::node</type></typedef>
4904<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
4905<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
4906<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
4907<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
4908<method-group name="public member functions">
4909<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4910<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4911<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4912<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4913<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4914<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4915<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4916<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4917<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4918<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4919<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4920<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4921<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4922<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4923<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4924<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
4925<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
4926<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4927<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
4928<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>sg_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
4929<method name="clone_from"><type>void</type><template>
4930          <template-type-parameter name="Cloner"/>
4931          <template-type-parameter name="Disposer"/>
4932        </template><parameter name="src"><paramtype>const <classname>sg_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
4933<method name="clone_from"><type>void</type><template>
4934          <template-type-parameter name="Cloner"/>
4935          <template-type-parameter name="Disposer"/>
4936        </template><parameter name="src"><paramtype><classname>sg_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
4937<method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4938<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4939<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
4940<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
4941<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
4942          <template-type-parameter name="KeyType"/>
4943          <template-type-parameter name="KeyTypeKeyCompare"/>
4944        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
4945<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
4946          <template-type-parameter name="KeyType"/>
4947          <template-type-parameter name="KeyTypeKeyCompare"/>
4948        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
4949<method name="insert"><type>void</type><template>
4950          <template-type-parameter name="Iterator"/>
4951        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
4952<method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
4953<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4954<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4955<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
4956<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4957<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4958<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4959<method name="erase"><type>size_type</type><template>
4960          <template-type-parameter name="KeyType"/>
4961          <template-type-parameter name="KeyTypeKeyCompare"/>
4962        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4963<method name="erase_and_dispose"><type>iterator</type><template>
4964          <template-type-parameter name="Disposer"/>
4965        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4966<method name="erase_and_dispose"><type>iterator</type><template>
4967          <template-type-parameter name="Disposer"/>
4968        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4969<method name="erase_and_dispose"><type>size_type</type><template>
4970          <template-type-parameter name="Disposer"/>
4971        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4972<method name="erase_and_dispose"><type>size_type</type><template>
4973          <template-type-parameter name="KeyType"/>
4974          <template-type-parameter name="KeyTypeKeyCompare"/>
4975          <template-type-parameter name="Disposer"/>
4976        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
4977<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
4978<method name="clear_and_dispose"><type>void</type><template>
4979          <template-type-parameter name="Disposer"/>
4980        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
4981<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4982<method name="count" cv="const"><type>size_type</type><template>
4983          <template-type-parameter name="KeyType"/>
4984          <template-type-parameter name="KeyTypeKeyCompare"/>
4985        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
4986<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4987<method name="lower_bound"><type>iterator</type><template>
4988          <template-type-parameter name="KeyType"/>
4989          <template-type-parameter name="KeyTypeKeyCompare"/>
4990        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4991<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4992<method name="lower_bound" cv="const"><type>const_iterator</type><template>
4993          <template-type-parameter name="KeyType"/>
4994          <template-type-parameter name="KeyTypeKeyCompare"/>
4995        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4996<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
4997<method name="upper_bound"><type>iterator</type><template>
4998          <template-type-parameter name="KeyType"/>
4999          <template-type-parameter name="KeyTypeKeyCompare"/>
5000        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5001<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5002<method name="upper_bound" cv="const"><type>const_iterator</type><template>
5003          <template-type-parameter name="KeyType"/>
5004          <template-type-parameter name="KeyTypeKeyCompare"/>
5005        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5006<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5007<method name="find"><type>iterator</type><template>
5008          <template-type-parameter name="KeyType"/>
5009          <template-type-parameter name="KeyTypeKeyCompare"/>
5010        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5011<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5012<method name="find" cv="const"><type>const_iterator</type><template>
5013          <template-type-parameter name="KeyType"/>
5014          <template-type-parameter name="KeyTypeKeyCompare"/>
5015        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5016<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5017<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
5018          <template-type-parameter name="KeyType"/>
5019          <template-type-parameter name="KeyTypeKeyCompare"/>
5020        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5021<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5022<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
5023          <template-type-parameter name="KeyType"/>
5024          <template-type-parameter name="KeyTypeKeyCompare"/>
5025        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5026<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
5027<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
5028          <template-type-parameter name="KeyType"/>
5029          <template-type-parameter name="KeyTypeKeyCompare"/>
5030        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
5031<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
5032<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
5033          <template-type-parameter name="KeyType"/>
5034          <template-type-parameter name="KeyTypeKeyCompare"/>
5035        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
5036<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5037<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5038<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
5039<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
5040<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
5041<method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
5042<method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
5043<method name="balance_factor" cv="const"><type>float</type><description><para><emphasis role="bold">Returns</emphasis>: The balance factor (alpha) used in this tree</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5044<method name="balance_factor"><type>void</type><parameter name="new_alpha"><paramtype>float</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_alpha must be a value between 0.5 and 1.0</para><para><emphasis role="bold">Effects</emphasis>: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
5045<method name="merge"><type>void</type><template>
5046          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
5047        </template><parameter name="source"><paramtype><classname>sg_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
5048<method name="merge"><type>void</type><template>
5049          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
5050        </template><parameter name="source"><paramtype><classname>sg_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
5051</method-group>
5052<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
5053<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
5054<constructor><template>
5055          <template-type-parameter name="Iterator"/>
5056        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
5057<constructor><parameter name="x"><paramtype><classname>sg_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
5058<copy-assignment><type><classname>sg_set</classname> &amp;</type><parameter name="x"><paramtype><classname>sg_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
5059<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
5060<method-group name="public static functions">
5061<method name="container_from_end_iterator" specifiers="static"><type><classname>sg_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5062<method name="container_from_end_iterator" specifiers="static"><type>const <classname>sg_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5063<method name="container_from_iterator" specifiers="static"><type><classname>sg_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
5064<method name="container_from_iterator" specifiers="static"><type>const <classname>sg_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
5065<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
5066<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
5067<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
5068</method-group>
5069</class>
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079<function name="operator!="><type>bool</type><template>
5080          <template-type-parameter name="T"/>
5081          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5082        </template><parameter name="x"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5083<function name="operator&gt;"><type>bool</type><template>
5084          <template-type-parameter name="T"/>
5085          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5086        </template><parameter name="x"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5087<function name="operator&lt;="><type>bool</type><template>
5088          <template-type-parameter name="T"/>
5089          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5090        </template><parameter name="x"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5091<function name="operator&gt;="><type>bool</type><template>
5092          <template-type-parameter name="T"/>
5093          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5094        </template><parameter name="x"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5095<function name="swap"><type>void</type><template>
5096          <template-type-parameter name="T"/>
5097          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5098        </template><parameter name="x"><paramtype><classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5099<function name="operator!="><type>bool</type><template>
5100          <template-type-parameter name="T"/>
5101          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5102        </template><parameter name="x"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5103<function name="operator&gt;"><type>bool</type><template>
5104          <template-type-parameter name="T"/>
5105          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5106        </template><parameter name="x"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5107<function name="operator&lt;="><type>bool</type><template>
5108          <template-type-parameter name="T"/>
5109          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5110        </template><parameter name="x"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5111<function name="operator&gt;="><type>bool</type><template>
5112          <template-type-parameter name="T"/>
5113          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5114        </template><parameter name="x"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5115<function name="swap"><type>void</type><template>
5116          <template-type-parameter name="T"/>
5117          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5118        </template><parameter name="x"><paramtype><classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151</namespace>
5152</namespace>
5153</header>
5154<header name="boost/intrusive/sgtree.hpp">
5155<namespace name="boost">
5156<namespace name="intrusive">
5157<struct name="make_sgtree"><template>
5158      <template-type-parameter name="T"/>
5159      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5160    </template><description><para>Helper metafunction to define a <computeroutput>sgtree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
5161</struct><class name="sgtree"><template>
5162      <template-type-parameter name="T"/>
5163      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5164    </template><description><para>The class template sgtree is an intrusive scapegoat tree container, that is used to construct intrusive <classname alt="boost::intrusive::sg_set">sg_set</classname> and <classname alt="boost::intrusive::sg_multiset">sg_multiset</classname> containers. The no-throw guarantee holds only, if the value_compare object doesn't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>floating_point&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
5165<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
5166<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
5167<typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
5168<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
5169<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
5170<typedef name="reference"><type>implementation_defined::reference</type></typedef>
5171<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
5172<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
5173<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
5174<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
5175<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
5176<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
5177<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
5178<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
5179<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
5180<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
5181<typedef name="node"><type>implementation_defined::node</type></typedef>
5182<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
5183<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
5184<typedef name="node_algorithms"><type>implementation_defined</type></typedef>
5185<typedef name="insert_commit_data"><type>implementation_defined</type></typedef>
5186<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
5187<data-member name="floating_point" specifiers="static"><type>const bool</type></data-member>
5188<data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
5189<method-group name="public member functions">
5190<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5191<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5192<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5193<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5194<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5195<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5196<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5197<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5198<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5199<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5200<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5201<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5202<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5203<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5204<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5205<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
5206<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
5207<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5208<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5209<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>sgtree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
5210<method name="clone_from"><type>void</type><template>
5211          <template-type-parameter name="Cloner"/>
5212          <template-type-parameter name="Disposer"/>
5213        </template><parameter name="src"><paramtype>const <classname>sgtree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
5214<method name="clone_from"><type>void</type><template>
5215          <template-type-parameter name="Cloner"/>
5216          <template-type-parameter name="Disposer"/>
5217        </template><parameter name="src"><paramtype><classname>sgtree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
5218<method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
5219<method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
5220<method name="insert_equal"><type>void</type><template>
5221          <template-type-parameter name="Iterator"/>
5222        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
5223<method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
5224<method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
5225<method name="insert_unique_check"><type>std::pair&lt; iterator BOOST_INTRUSIVE_I bool &gt;</type><template>
5226          <template-type-parameter name="KeyType"/>
5227          <template-type-parameter name="KeyTypeKeyCompare"/>
5228        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
5229<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
5230          <template-type-parameter name="KeyType"/>
5231          <template-type-parameter name="KeyTypeKeyCompare"/>
5232        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
5233<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
5234<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
5235<method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
5236<method name="insert_unique"><type>void</type><template>
5237          <template-type-parameter name="Iterator"/>
5238        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
5239<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
5240<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
5241<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
5242<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5243<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5244<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5245<method name="erase"><type>size_type</type><template>
5246          <template-type-parameter name="KeyType"/>
5247          <template-type-parameter name="KeyTypeKeyCompare"/>
5248        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5249<method name="erase_and_dispose"><type>iterator</type><template>
5250          <template-type-parameter name="Disposer"/>
5251        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
5252<method name="erase_and_dispose"><type>iterator</type><template>
5253          <template-type-parameter name="Disposer"/>
5254        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
5255<method name="erase_and_dispose"><type>size_type</type><template>
5256          <template-type-parameter name="Disposer"/>
5257        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5258<method name="erase_and_dispose"><type>size_type</type><template>
5259          <template-type-parameter name="KeyType"/>
5260          <template-type-parameter name="KeyTypeKeyCompare"/>
5261          <template-type-parameter name="Disposer"/>
5262        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
5263<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5264<method name="clear_and_dispose"><type>void</type><template>
5265          <template-type-parameter name="Disposer"/>
5266        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
5267<method name="merge_unique"><type>void</type><template>
5268          <template-type-parameter name="T"/>
5269          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
5270        </template><parameter name=""><paramtype><classname>sgtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
5271<method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
5272<method name="merge_equal"><type>void</type><template>
5273          <template-type-parameter name="T"/>
5274          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
5275        </template><parameter name=""><paramtype><classname>sgtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
5276<method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
5277<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5278<method name="count" cv="const"><type>size_type</type><template>
5279          <template-type-parameter name="KeyType"/>
5280          <template-type-parameter name="KeyTypeKeyCompare"/>
5281        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5282<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5283<method name="lower_bound"><type>iterator</type><template>
5284          <template-type-parameter name="KeyType"/>
5285          <template-type-parameter name="KeyTypeKeyCompare"/>
5286        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5287<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5288<method name="lower_bound" cv="const"><type>const_iterator</type><template>
5289          <template-type-parameter name="KeyType"/>
5290          <template-type-parameter name="KeyTypeKeyCompare"/>
5291        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5292<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5293<method name="upper_bound"><type>iterator</type><template>
5294          <template-type-parameter name="KeyType"/>
5295          <template-type-parameter name="KeyTypeKeyCompare"/>
5296        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5297<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5298<method name="upper_bound" cv="const"><type>const_iterator</type><template>
5299          <template-type-parameter name="KeyType"/>
5300          <template-type-parameter name="KeyTypeKeyCompare"/>
5301        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5302<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5303<method name="find"><type>iterator</type><template>
5304          <template-type-parameter name="KeyType"/>
5305          <template-type-parameter name="KeyTypeKeyCompare"/>
5306        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5307<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5308<method name="find" cv="const"><type>const_iterator</type><template>
5309          <template-type-parameter name="KeyType"/>
5310          <template-type-parameter name="KeyTypeKeyCompare"/>
5311        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5312<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5313<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
5314          <template-type-parameter name="KeyType"/>
5315          <template-type-parameter name="KeyTypeKeyCompare"/>
5316        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5317<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
5318<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
5319          <template-type-parameter name="KeyType"/>
5320          <template-type-parameter name="KeyTypeKeyCompare"/>
5321        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
5322<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
5323<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
5324          <template-type-parameter name="KeyType"/>
5325          <template-type-parameter name="KeyTypeKeyCompare"/>
5326        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
5327<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
5328<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
5329          <template-type-parameter name="KeyType"/>
5330          <template-type-parameter name="KeyTypeKeyCompare"/>
5331        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
5332<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5333<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5334<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
5335<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
5336<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
5337<method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
5338<method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
5339<method name="balance_factor" cv="const"><type>float</type><description><para><emphasis role="bold">Returns</emphasis>: The balance factor (alpha) used in this tree</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5340<method name="balance_factor"><type>void</type><parameter name="new_alpha"><paramtype>float</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_alpha must be a value between 0.5 and 1.0</para><para><emphasis role="bold">Effects</emphasis>: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
5341</method-group>
5342<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
5343<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
5344<constructor><template>
5345          <template-type-parameter name="Iterator"/>
5346        </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
5347<constructor><parameter name="x"><paramtype><classname>sgtree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
5348<copy-assignment><type><classname>sgtree</classname> &amp;</type><parameter name="x"><paramtype><classname>sgtree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
5349<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
5350<method-group name="public static functions">
5351<method name="container_from_end_iterator" specifiers="static"><type><classname>sgtree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5352<method name="container_from_end_iterator" specifiers="static"><type>const <classname>sgtree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5353<method name="container_from_iterator" specifiers="static"><type><classname>sgtree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
5354<method name="container_from_iterator" specifiers="static"><type>const <classname>sgtree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
5355<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
5356<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
5357<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
5358</method-group>
5359</class>
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411</namespace>
5412</namespace>
5413</header>
5414<header name="boost/intrusive/sgtree_algorithms.hpp">
5415<namespace name="boost">
5416<namespace name="intrusive">
5417<class name="sgtree_algorithms"><template>
5418      <template-type-parameter name="NodeTraits"/>
5419    </template><description><para><classname alt="boost::intrusive::sgtree_algorithms">sgtree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput> </para></description><struct name="insert_commit_data"><inherit access="public">insert_commit_data</inherit><description><para>This type is the information that will be filled by insert_unique_check </para></description><data-member name="depth"><type>std::size_t</type></data-member>
5420</struct><typedef name="node"><type>NodeTraits::node</type></typedef>
5421<typedef name="node_traits"><type>NodeTraits</type></typedef>
5422<typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
5423<typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
5424<method-group name="public static functions">
5425<method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5426<method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5427<method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5428<method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5429<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
5430<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
5431<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
5432<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
5433<method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><purpose>static void unlink(node_ptr node); </purpose><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
5434<method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5435<method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5436<method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5437<method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5438<method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
5439<method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
5440<method name="erase" specifiers="static"><type>node_ptr</type><template>
5441          <template-type-parameter name="AlphaByMaxSize"/>
5442        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="alpha_by_maxsize"><paramtype>AlphaByMaxSize</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5443<method name="clone" specifiers="static"><type>void</type><template>
5444          <template-type-parameter name="Cloner"/>
5445          <template-type-parameter name="Disposer"/>
5446        </template><parameter name="source_header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
5447<method name="clear_and_dispose" specifiers="static"><type>void</type><template>
5448          <template-type-parameter name="Disposer"/>
5449        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
5450<method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
5451          <template-type-parameter name="KeyType"/>
5452          <template-type-parameter name="KeyNodePtrCompare"/>
5453        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
5454<method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
5455          <template-type-parameter name="KeyType"/>
5456          <template-type-parameter name="KeyNodePtrCompare"/>
5457        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
5458<method name="find" specifiers="static"><type>node_ptr</type><template>
5459          <template-type-parameter name="KeyType"/>
5460          <template-type-parameter name="KeyNodePtrCompare"/>
5461        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
5462<method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
5463          <template-type-parameter name="KeyType"/>
5464          <template-type-parameter name="KeyNodePtrCompare"/>
5465        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
5466<method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
5467          <template-type-parameter name="KeyType"/>
5468          <template-type-parameter name="KeyNodePtrCompare"/>
5469        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
5470<method name="count" specifiers="static"><type>std::size_t</type><template>
5471          <template-type-parameter name="KeyType"/>
5472          <template-type-parameter name="KeyNodePtrCompare"/>
5473        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
5474<method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
5475          <template-type-parameter name="NodePtrCompare"/>
5476          <template-type-parameter name="H_Alpha"/>
5477        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
5478<method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
5479          <template-type-parameter name="NodePtrCompare"/>
5480          <template-type-parameter name="H_Alpha"/>
5481        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
5482<method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
5483          <template-type-parameter name="NodePtrCompare"/>
5484          <template-type-parameter name="H_Alpha"/>
5485        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
5486<method name="insert_before" specifiers="static"><type>node_ptr</type><template>
5487          <template-type-parameter name="H_Alpha"/>
5488        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
5489<method name="push_back" specifiers="static"><type>void</type><template>
5490          <template-type-parameter name="H_Alpha"/>
5491        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
5492<method name="push_front" specifiers="static"><type>void</type><template>
5493          <template-type-parameter name="H_Alpha"/>
5494        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
5495<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
5496          <template-type-parameter name="KeyType"/>
5497          <template-type-parameter name="KeyNodePtrCompare"/>
5498        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype><classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
5499<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
5500          <template-type-parameter name="KeyType"/>
5501          <template-type-parameter name="KeyNodePtrCompare"/>
5502        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype><classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
5503<method name="insert_unique_commit" specifiers="static"><type>void</type><template>
5504          <template-type-parameter name="H_Alpha"/>
5505        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const <classname>insert_commit_data</classname> &amp;</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
5506<method name="transfer_unique" specifiers="static"><type>bool</type><template>
5507          <template-type-parameter name="NodePtrCompare"/>
5508          <template-type-parameter name="H_Alpha"/>
5509          <template-type-parameter name="AlphaByMaxSize"/>
5510        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree1_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree1_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="tree2_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree2_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="alpha_by_maxsize"><paramtype>AlphaByMaxSize</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
5511<method name="transfer_equal" specifiers="static"><type>void</type><template>
5512          <template-type-parameter name="NodePtrCompare"/>
5513          <template-type-parameter name="H_Alpha"/>
5514          <template-type-parameter name="AlphaByMaxSize"/>
5515        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree1_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree1_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="tree2_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree2_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="alpha_by_maxsize"><paramtype>AlphaByMaxSize</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
5516<method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5517<method name="rebalance" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5518</method-group>
5519</class>
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571</namespace>
5572</namespace>
5573</header>
5574<header name="boost/intrusive/slist.hpp">
5575<namespace name="boost">
5576<namespace name="intrusive">
5577<struct name="make_slist"><template>
5578      <template-type-parameter name="T"/>
5579      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5580    </template><description><para>Helper metafunction to define a <computeroutput>slist</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
5581</struct><class name="slist"><template>
5582      <template-type-parameter name="T"/>
5583      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5584    </template><description><para>The class template slist is an intrusive container, that encapsulates a singly-linked list. You can use such a list to squeeze the last bit of performance from your application. Unfortunately, the little gains come with some huge drawbacks. A lot of member functions can't be implemented as efficiently as for standard containers. To overcome this limitation some other member functions with rather unusual semantics have to be introduced.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>linear&lt;&gt;</computeroutput> and <computeroutput>cache_last&lt;&gt;</computeroutput>.</para><para>The iterators of slist are forward iterators. slist provides a static function called "previous" to compute the previous iterator of a given iterator. This function has linear complexity. To improve the usability esp. with the '*_after' functions, ++end() == begin() and previous(begin()) == end() are defined. An new special function "before_begin()" is defined, which returns an iterator that points one less the beginning of the list: ++before_begin() == begin() </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
5585<typedef name="pointer"><type>value_traits::pointer</type></typedef>
5586<typedef name="const_pointer"><type>value_traits::const_pointer</type></typedef>
5587<typedef name="value_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::element_type</type></typedef>
5588<typedef name="reference"><type><classname>pointer_traits</classname>&lt; pointer &gt;::reference</type></typedef>
5589<typedef name="const_reference"><type><classname>pointer_traits</classname>&lt; const_pointer &gt;::reference</type></typedef>
5590<typedef name="difference_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::difference_type</type></typedef>
5591<typedef name="size_type"><type>SizeType</type></typedef>
5592<typedef name="iterator"><type>slist_iterator&lt; value_traits, false &gt;</type></typedef>
5593<typedef name="const_iterator"><type>slist_iterator&lt; value_traits, true &gt;</type></typedef>
5594<typedef name="node_traits"><type>value_traits::node_traits</type></typedef>
5595<typedef name="node"><type>node_traits::node</type></typedef>
5596<typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
5597<typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
5598<typedef name="header_holder_type"><type><emphasis>unspecified</emphasis></type></typedef>
5599<typedef name="node_algorithms"><type><emphasis>unspecified</emphasis></type></typedef>
5600<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
5601<data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
5602<data-member name="linear" specifiers="static"><type>const bool</type></data-member>
5603<data-member name="cache_last" specifiers="static"><type>const bool</type></data-member>
5604<data-member name="has_container_from_iterator" specifiers="static"><type>const bool</type></data-member>
5605<method-group name="public member functions">
5606<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements of the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of the list. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
5607<method name="clear_and_dispose"><type>void</type><template>
5608          <template-type-parameter name="Disposer"/>
5609        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements of the container Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of the list.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
5610<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the front of the list. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
5611<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the back of the list. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. This function is only available is cache_last&lt;&gt; is true. </para></description></method>
5612<method name="pop_front"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases the first element of the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
5613<method name="pop_front_and_dispose"><type>void</type><template>
5614          <template-type-parameter name="Disposer"/>
5615        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the first element of the list. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
5616<method name="front"><type>reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reference to the first element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5617<method name="front" cv="const"><type>const_reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reference to the first element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5618<method name="back"><type>reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reference to the last element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. This function is only available is cache_last&lt;&gt; is true. </para></description></method>
5619<method name="back" cv="const"><type>const_reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reference to the last element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. This function is only available is cache_last&lt;&gt; is true. </para></description></method>
5620<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5621<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5622<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5623<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5624<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5625<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5626<method name="before_begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator that points to a position before the first element. Equivalent to "end()"</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5627<method name="before_begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator that points to a position before the first element. Equivalent to "end()"</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5628<method name="cbefore_begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator that points to a position before the first element. Equivalent to "end()"</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5629<method name="last"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the last element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: This function is present only if cached_last&lt;&gt; option is true. </para></description></method>
5630<method name="last" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the last element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: This function is present only if cached_last&lt;&gt; option is true. </para></description></method>
5631<method name="clast" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the last element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: This function is present only if cached_last&lt;&gt; option is true. </para></description></method>
5632<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of the elements contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements contained in the list. if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is false. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
5633<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the list contains no elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
5634<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the elements of x and *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of both lists. Constant-time if linear&lt;&gt; and/or cache_last&lt;&gt; options are used.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
5635<method name="shift_backwards"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><default>1</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves backwards all the elements, so that the first element becomes the second, the second becomes the third... the last element becomes the first one.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number shifts.</para><para><emphasis role="bold">Note</emphasis>: Iterators Does not affect the validity of iterators and references. </para></description></method>
5636<method name="shift_forward"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><default>1</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves forward all the elements, so that the second element becomes the first, the third becomes the second... the first element becomes the last one.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number shifts.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
5637<method name="clone_from"><type>void</type><template>
5638          <template-type-parameter name="Cloner"/>
5639          <template-type-parameter name="Disposer"/>
5640        </template><parameter name="src"><paramtype>const <classname>slist</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws. </para></description></method>
5641<method name="clone_from"><type>void</type><template>
5642          <template-type-parameter name="Cloner"/>
5643          <template-type-parameter name="Disposer"/>
5644        </template><parameter name="src"><paramtype><classname>slist</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws. </para></description></method>
5645<method name="insert_after"><type>iterator</type><parameter name="prev_p"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and prev_p must point to an element contained by the list or to end().</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value after the position pointed by prev_p. No copy constructor is called.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the inserted element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
5646<method name="insert_after"><type>void</type><template>
5647          <template-type-parameter name="Iterator"/>
5648        </template><parameter name="prev_p"><paramtype>const_iterator</paramtype></parameter><parameter name="f"><paramtype>Iterator</paramtype></parameter><parameter name="l"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type and prev_p must point to an element contained by the list or to the end node.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the [f, l) after the position prev_p.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
5649<method name="insert"><type>iterator</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and p must point to an element contained by the list or to end().</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value before the position pointed by p. No copy constructor is called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before p. Constant-time if cache_last&lt;&gt; is true and p == end().</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
5650<method name="insert"><type>void</type><template>
5651          <template-type-parameter name="Iterator"/>
5652        </template><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type and p must point to an element contained by the list or to the end node.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the pointed by b and e before the position p. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements before b. Linear to the number of elements to insert if cache_last&lt;&gt; option is true and p == end().</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
5653<method name="erase_after"><type>iterator</type><parameter name="prev"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element after the element pointed by prev of the list. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
5654<method name="erase_after"><type>iterator</type><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range (before_f, l) from the list. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of erased elements if it's a safe-mode , auto-unlink value or constant-time size is activated. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
5655<method name="erase_after"><type>iterator</type><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range (before_f, l) from the list. n must be distance(before_f, l) - 1. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: constant-time if <classname alt="boost::intrusive::link_mode">link_mode</classname> is normal_link. Linear to the elements (l - before_f) otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
5656<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed by i of the list. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed element, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements before i.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
5657<method name="erase"><type>iterator</type><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: f and l must be valid iterator to elements in *this.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed by b and e. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements before l.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
5658<method name="erase"><type>iterator</type><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range [f, l) from the list. n must be distance(f, l). No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: linear to the elements before f if <classname alt="boost::intrusive::link_mode">link_mode</classname> is normal_link and <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is activated. Linear to the elements before l otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
5659<method name="erase_after_and_dispose"><type>iterator</type><template>
5660          <template-type-parameter name="Disposer"/>
5661        </template><parameter name="prev"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element after the element pointed by prev of the list. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
5662<method name="erase_after_and_dispose"><type>iterator</type><template>
5663          <template-type-parameter name="Disposer"/>
5664        </template><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range (before_f, l) from the list. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements (l - before_f + 1).</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
5665<method name="erase_and_dispose"><type>iterator</type><template>
5666          <template-type-parameter name="Disposer"/>
5667        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed by i of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed element, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements before i.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
5668<method name="erase_and_dispose"><type>iterator</type><template>
5669          <template-type-parameter name="Disposer"/>
5670        </template><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: f and l must be valid iterator to elements in *this. Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed by b and e. No destructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of erased elements plus linear to the elements before f.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
5671<method name="assign"><type>void</type><template>
5672          <template-type-parameter name="Iterator"/>
5673        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements contained in the list if it's a safe-mode or auto-unlink value. Linear to the number of elements inserted in the list otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
5674<method name="dispose_and_assign"><type>void</type><template>
5675          <template-type-parameter name="Iterator"/>
5676          <template-type-parameter name="Disposer"/>
5677        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements contained in the list.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
5678<method name="splice_after"><type>void</type><parameter name="prev"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="l"><paramtype>const_iterator *</paramtype><default>0</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev must point to an element contained by this list or to the before_begin() element</para><para><emphasis role="bold">Effects</emphasis>: Transfers all the elements of list x to this list, after the the element pointed by prev. No destructors or copy constructors are called.</para><para><emphasis role="bold">Returns</emphasis>: Nothing.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: In general, linear to the elements contained in x. Constant-time if cache_last&lt;&gt; option is true and also constant-time if linear&lt;&gt; option is true "this" is empty and "l" is not used.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.</para><para><emphasis role="bold">Additional note</emphasis>: If the optional parameter "l" is provided, it will be assigned to the last spliced element or prev if x is empty. This iterator can be used as new "prev" iterator for a new splice_after call. that will splice new values after the previously spliced values. </para></description></method>
5679<method name="splice_after"><type>void</type><parameter name="prev_pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="prev_ele"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev must point to an element contained by this list or to the before_begin() element. prev_ele must point to an element contained in list x or must be x.before_begin().</para><para><emphasis role="bold">Effects</emphasis>: Transfers the element after prev_ele, from list x to this list, after the element pointed by prev. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
5680<method name="splice_after"><type>void</type><parameter name="prev_pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="before_l"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_pos must be a dereferenceable iterator in *this or be before_begin(), and before_f and before_l belong to x and ++before_f != x.end() &amp;&amp; before_l != x.end().</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range (before_f, before_l] from list x to this list, after the element pointed by prev_pos. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements transferred if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is true. Constant-time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
5681<method name="splice_after"><type>void</type><parameter name="prev_pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="before_l"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_pos must be a dereferenceable iterator in *this or be before_begin(), and before_f and before_l belong to x and ++before_f != x.end() &amp;&amp; before_l != x.end() and n == distance(before_f, before_l).</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range (before_f, before_l] from list x to this list, after the element pointed by p. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
5682<method name="splice"><type>void</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="l"><paramtype>const_iterator *</paramtype><default>0</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: it is an iterator to an element in *this.</para><para><emphasis role="bold">Effects</emphasis>: Transfers all the elements of list x to this list, before the the element pointed by it. No destructors or copy constructors are called.</para><para><emphasis role="bold">Returns</emphasis>: Nothing.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements contained in x plus linear to the elements before it. Linear to the elements before it if cache_last&lt;&gt; option is true. Constant-time if cache_last&lt;&gt; option is true and it == end().</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.</para><para><emphasis role="bold">Additional note</emphasis>: If the optional parameter "l" is provided, it will be assigned to the last spliced element or prev if x is empty. This iterator can be used as new "prev" iterator for a new splice_after call. that will splice new values after the previously spliced values. </para></description></method>
5683<method name="splice"><type>void</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="elem"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: it p must be a valid iterator of *this. elem must point to an element contained in list x.</para><para><emphasis role="bold">Effects</emphasis>: Transfers the element elem, from list x to this list, before the element pointed by pos. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements before pos and before elem. Linear to the elements before elem if cache_last&lt;&gt; option is true and pos == end().</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
5684<method name="splice"><type>void</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: pos must be a dereferenceable iterator in *this and f and f belong to x and f and f a valid range on x.</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range [f, l) from list x to this list, before the element pointed by pos. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the sum of elements before pos, f, and l plus linear to the number of elements transferred if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is true. Linear to the sum of elements before f, and l plus linear to the number of elements transferred if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is true if cache_last&lt;&gt; is true and pos == end()</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
5685<method name="splice"><type>void</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: pos must be a dereferenceable iterator in *this and f and l belong to x and f and l a valid range on x. n == distance(f, l).</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range [f, l) from list x to this list, before the element pointed by pos. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the sum of elements before pos, f, and l. Linear to the sum of elements before f and l if cache_last&lt;&gt; is true and pos == end().</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
5686<method name="sort"><type>void</type><template>
5687          <template-type-parameter name="Predicate"/>
5688        </template><parameter name="p"><paramtype>Predicate</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: This function sorts the list *this according to std::less&lt;value_type&gt;. The sort is stable, that is, the relative order of equivalent elements is preserved.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: The number of comparisons is approximately N log N, where N is the list's size.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
5689<method name="sort"><type>void</type><description><para><emphasis role="bold">Requires</emphasis>: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.</para><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or std::less&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
5690<method name="merge"><type>void</type><template>
5691          <template-type-parameter name="Predicate"/>
5692        </template><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="p"><paramtype>Predicate</paramtype></parameter><parameter name="l"><paramtype>const_iterator *</paramtype><default>0</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.</para><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Returns</emphasis>: Nothing.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated.</para><para><emphasis role="bold">Additional note</emphasis>: If optional "l" argument is passed, it is assigned to an iterator to the last transferred value or end() is x is empty. </para></description></method>
5693<method name="merge"><type>void</type><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this according to std::less&lt;value_type&gt;. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Throws</emphasis>: if std::less&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
5694<method name="reverse"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear to the contained elements.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
5695<method name="remove"><type>void</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes all the elements that compare equal to value. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. This function is linear time: it performs exactly size() comparisons for equality. </para></description></method>
5696<method name="remove_and_dispose"><type>void</type><template>
5697          <template-type-parameter name="Disposer"/>
5698        </template><parameter name="value"><paramtype>const_reference</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes all the elements that compare equal to value. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
5699<method name="remove_if"><type>void</type><template>
5700          <template-type-parameter name="Pred"/>
5701        </template><parameter name="pred"><paramtype>Pred</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes all the elements for which a specified predicate is satisfied. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() calls to the predicate.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
5702<method name="remove_and_dispose_if"><type>void</type><template>
5703          <template-type-parameter name="Pred"/>
5704          <template-type-parameter name="Disposer"/>
5705        </template><parameter name="pred"><paramtype>Pred</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes all the elements for which a specified predicate is satisfied. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
5706<method name="unique"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that are equal from the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons calls to pred()).</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
5707<method name="unique"><type>void</type><template>
5708          <template-type-parameter name="BinaryPredicate"/>
5709        </template><parameter name="pred"><paramtype>BinaryPredicate</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
5710<method name="unique_and_dispose"><type>void</type><template>
5711          <template-type-parameter name="Disposer"/>
5712        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
5713<method name="unique_and_dispose"><type>void</type><template>
5714          <template-type-parameter name="BinaryPredicate"/>
5715          <template-type-parameter name="Disposer"/>
5716        </template><parameter name="pred"><paramtype>BinaryPredicate</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
5717<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns a const_iterator pointing to the element</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
5718<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a const reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns an iterator pointing to the element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
5719<method name="previous"><type>iterator</type><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: The iterator to the element before i in the list. Returns the end-iterator, if either i is the begin-iterator or the list is empty.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before i. Constant if cache_last&lt;&gt; is true and i == end(). </para></description></method>
5720<method name="previous" cv="const"><type>const_iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: The const_iterator to the element before i in the list. Returns the end-const_iterator, if either i is the begin-const_iterator or the list is empty.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before i. Constant if cache_last&lt;&gt; is true and i == end(). </para></description></method>
5721<method name="previous"><type>iterator</type><parameter name="prev_from"><paramtype>const_iterator</paramtype></parameter><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: The iterator to the element before i in the list, starting the search on element after prev_from. Returns the end-iterator, if either i is the begin-iterator or the list is empty.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before i. Constant if cache_last&lt;&gt; is true and i == end(). </para></description></method>
5722<method name="previous" cv="const"><type>const_iterator</type><parameter name="prev_from"><paramtype>const_iterator</paramtype></parameter><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: The const_iterator to the element before i in the list, starting the search on element after prev_from. Returns the end-const_iterator, if either i is the begin-const_iterator or the list is empty.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before i. Constant if cache_last&lt;&gt; is true and i == end(). </para></description></method>
5723<method name="check" cv="const"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
5724</method-group>
5725<constructor><description><para><emphasis role="bold">Effects</emphasis>: constructs an empty list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
5726<constructor specifiers="explicit"><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: constructs an empty list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
5727<constructor><template>
5728          <template-type-parameter name="Iterator"/>
5729        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs a list equal to [b ,e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in distance(b, e). No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
5730<constructor><parameter name="x"><paramtype><classname>slist</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of value traits throws. </para></description></constructor>
5731<copy-assignment><type><classname>slist</classname> &amp;</type><parameter name="x"><paramtype><classname>slist</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
5732<destructor><description><para><emphasis role="bold">Effects</emphasis>: If it's a safe-mode or auto-unlink value, the destructor does nothing (ie. no code is generated). Otherwise it detaches all elements from this. In this case the objects in the list are not deleted (i.e. no destructors are called), but the hooks according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are set to their default value.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the list, if it's a safe-mode or auto-unlink value. Otherwise constant. </para></description></destructor>
5733<method-group name="public static functions">
5734<method name="container_from_end_iterator" specifiers="static"><type><classname>slist</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of slist.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the slist associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5735<method name="container_from_end_iterator" specifiers="static"><type>const <classname>slist</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end const_iterator of slist.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the slist associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
5736<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns a const_iterator pointing to the element</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
5737<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a const reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns an iterator pointing to the element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
5738</method-group>
5739<method-group name="private member functions">
5740<method name="priv_splice_after"><type>void</type><parameter name="prev_pos_n"><paramtype>node_ptr</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="before_f_n"><paramtype>node_ptr</paramtype></parameter><parameter name="before_l_n"><paramtype>node_ptr</paramtype></parameter></method>
5741<method name="priv_incorporate_after"><type>void</type><parameter name="prev_pos_n"><paramtype>node_ptr</paramtype></parameter><parameter name="first_n"><paramtype>node_ptr</paramtype></parameter><parameter name="before_l_n"><paramtype>node_ptr</paramtype></parameter></method>
5742<method name="priv_reverse"><type>void</type><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
5743<method name="priv_reverse"><type>void</type><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
5744<method name="priv_shift_backwards"><type>void</type><parameter name="n"><paramtype>size_type</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
5745<method name="priv_shift_backwards"><type>void</type><parameter name="n"><paramtype>size_type</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
5746<method name="priv_shift_forward"><type>void</type><parameter name="n"><paramtype>size_type</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
5747<method name="priv_shift_forward"><type>void</type><parameter name="n"><paramtype>size_type</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
5748</method-group>
5749<method-group name="private static functions">
5750<method name="priv_swap_cache_last" specifiers="static"><type>void</type><parameter name="this_impl"><paramtype><classname>slist</classname> *</paramtype></parameter><parameter name="other_impl"><paramtype><classname>slist</classname> *</paramtype></parameter></method>
5751<method name="priv_swap_lists" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
5752<method name="priv_swap_lists" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
5753<method name="priv_container_from_end_iterator" specifiers="static"><type><classname>slist</classname> &amp;</type><parameter name="end_iterator"><paramtype>const const_iterator &amp;</paramtype></parameter></method>
5754</method-group>
5755</class>
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807</namespace>
5808</namespace>
5809</header>
5810<header name="boost/intrusive/slist_hook.hpp">
5811<namespace name="boost">
5812<namespace name="intrusive">
5813<struct name="make_slist_base_hook"><template>
5814      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5815    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::slist_base_hook">slist_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
5816</struct><struct name="make_slist_member_hook"><template>
5817      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5818    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::slist_member_hook">slist_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
5819</struct><class name="slist_base_hook"><template>
5820      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5821    </template><inherit access="public">make_slist_base_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::slist_base_hook">slist_base_hook</classname> in order to store objects in in an list. <classname alt="boost::intrusive::slist_base_hook">slist_base_hook</classname> holds the data necessary to maintain the list and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for list.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
5822<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>slist_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5823<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>slist::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
5824<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5825</method-group>
5826<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
5827<constructor><parameter name=""><paramtype>const <classname>slist_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
5828<copy-assignment><type><classname>slist_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>slist_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
5829<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an slist an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
5830</class><class name="slist_member_hook"><template>
5831      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5832    </template><inherit access="public">make_slist_member_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::slist_member_hook">slist_member_hook</classname> in order to store objects of this class in an list. <classname alt="boost::intrusive::slist_member_hook">slist_member_hook</classname> holds the data necessary for maintaining the list and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for list.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
5833<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>slist_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5834<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>slist::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Note</emphasis>: If this member is called when the value is inserted in a slist with the option linear&lt;true&gt;, this function will return "false" for the last element, as it is not linked to anything (the next element is null), so use with care.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
5835<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5836</method-group>
5837<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
5838<constructor><parameter name=""><paramtype>const <classname>slist_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
5839<copy-assignment><type><classname>slist_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>slist_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
5840<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an slist an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
5841</class>
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893</namespace>
5894</namespace>
5895</header>
5896<header name="boost/intrusive/splay_set.hpp">
5897<namespace name="boost">
5898<namespace name="intrusive">
5899<struct name="make_splay_multiset"><template>
5900      <template-type-parameter name="T"/>
5901      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5902    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::splay_multiset">splay_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
5903</struct><struct name="make_splay_set"><template>
5904      <template-type-parameter name="T"/>
5905      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5906    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::splay_set">splay_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
5907</struct><class name="splay_multiset"><template>
5908      <template-type-parameter name="T"/>
5909      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
5910    </template><description><para>The class template <classname alt="boost::intrusive::splay_multiset">splay_multiset</classname> is an intrusive container, that mimics most of the interface of std::multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
5911<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
5912<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
5913<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
5914<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
5915<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
5916<typedef name="reference"><type>implementation_defined::reference</type></typedef>
5917<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
5918<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
5919<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
5920<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
5921<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
5922<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
5923<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
5924<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
5925<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
5926<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
5927<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
5928<typedef name="node"><type>implementation_defined::node</type></typedef>
5929<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
5930<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
5931<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
5932<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
5933<method-group name="public member functions">
5934<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5935<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5936<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5937<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5938<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5939<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5940<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5941<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5942<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5943<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5944<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5945<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5946<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5947<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5948<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5949<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
5950<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
5951<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5952<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
5953<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>splay_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
5954<method name="clone_from"><type>void</type><template>
5955          <template-type-parameter name="Cloner"/>
5956          <template-type-parameter name="Disposer"/>
5957        </template><parameter name="src"><paramtype>const <classname>splay_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
5958<method name="clone_from"><type>void</type><template>
5959          <template-type-parameter name="Cloner"/>
5960          <template-type-parameter name="Disposer"/>
5961        </template><parameter name="src"><paramtype><classname>splay_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
5962<method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
5963<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
5964<method name="insert"><type>void</type><template>
5965          <template-type-parameter name="Iterator"/>
5966        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
5967<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
5968<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
5969<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
5970<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5971<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5972<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5973<method name="erase"><type>size_type</type><template>
5974          <template-type-parameter name="KeyType"/>
5975          <template-type-parameter name="KeyTypeKeyCompare"/>
5976        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5977<method name="erase_and_dispose"><type>iterator</type><template>
5978          <template-type-parameter name="Disposer"/>
5979        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
5980<method name="erase_and_dispose"><type>iterator</type><template>
5981          <template-type-parameter name="Disposer"/>
5982        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
5983<method name="erase_and_dispose"><type>size_type</type><template>
5984          <template-type-parameter name="Disposer"/>
5985        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5986<method name="erase_and_dispose"><type>size_type</type><template>
5987          <template-type-parameter name="KeyType"/>
5988          <template-type-parameter name="KeyTypeKeyCompare"/>
5989          <template-type-parameter name="Disposer"/>
5990        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
5991<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
5992<method name="clear_and_dispose"><type>void</type><template>
5993          <template-type-parameter name="Disposer"/>
5994        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
5995<method name="count"><type>size_type</type><parameter name=""><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
5996<method name="count"><type>size_type</type><template>
5997          <template-type-parameter name="KeyType"/>
5998          <template-type-parameter name="KeyTypeKeyCompare"/>
5999        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6000<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
6001<method name="lower_bound"><type>iterator</type><template>
6002          <template-type-parameter name="KeyType"/>
6003          <template-type-parameter name="KeyTypeKeyCompare"/>
6004        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6005<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6006<method name="lower_bound" cv="const"><type>const_iterator</type><template>
6007          <template-type-parameter name="KeyType"/>
6008          <template-type-parameter name="KeyTypeKeyCompare"/>
6009        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6010<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
6011<method name="upper_bound"><type>iterator</type><template>
6012          <template-type-parameter name="KeyType"/>
6013          <template-type-parameter name="KeyTypeKeyCompare"/>
6014        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6015<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6016<method name="upper_bound" cv="const"><type>const_iterator</type><template>
6017          <template-type-parameter name="KeyType"/>
6018          <template-type-parameter name="KeyTypeKeyCompare"/>
6019        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6020<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
6021<method name="find"><type>iterator</type><template>
6022          <template-type-parameter name="KeyType"/>
6023          <template-type-parameter name="KeyTypeKeyCompare"/>
6024        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6025<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6026<method name="find" cv="const"><type>const_iterator</type><template>
6027          <template-type-parameter name="KeyType"/>
6028          <template-type-parameter name="KeyTypeKeyCompare"/>
6029        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6030<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
6031<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
6032          <template-type-parameter name="KeyType"/>
6033          <template-type-parameter name="KeyTypeKeyCompare"/>
6034        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6035<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6036<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
6037          <template-type-parameter name="KeyType"/>
6038          <template-type-parameter name="KeyTypeKeyCompare"/>
6039        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6040<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_value"><paramtype>const_reference</paramtype></parameter><parameter name="upper_value"><paramtype>const_reference</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6041<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
6042          <template-type-parameter name="KeyType"/>
6043          <template-type-parameter name="KeyTypeKeyCompare"/>
6044        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6045<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_value"><paramtype>const_reference</paramtype></parameter><parameter name="upper_value"><paramtype>const_reference</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6046<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
6047          <template-type-parameter name="KeyType"/>
6048          <template-type-parameter name="KeyTypeKeyCompare"/>
6049        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6050<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6051<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6052<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
6053<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
6054<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
6055<method name="splay_up"><type>void</type><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: i must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that the element pointed by i is placed as the root of the tree, improving future searches of this value.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6056<method name="splay_down"><type>iterator</type><template>
6057          <template-type-parameter name="KeyType"/>
6058          <template-type-parameter name="KeyTypeKeyCompare"/>
6059        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree. If the element is not present returns the last node compared with the key. If the tree is empty, end() is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor throws. </para></description></method>
6060<method name="splay_down"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. </para></description></method>
6061<method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
6062<method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
6063<method name="merge"><type>void</type><template>
6064          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
6065        </template><parameter name="source"><paramtype><classname>splay_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
6066<method name="merge"><type>void</type><template>
6067          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
6068        </template><parameter name="source"><paramtype><classname>splay_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
6069</method-group>
6070<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
6071<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
6072<constructor><template>
6073          <template-type-parameter name="Iterator"/>
6074        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
6075<constructor><parameter name="x"><paramtype><classname>splay_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
6076<copy-assignment><type><classname>splay_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>splay_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
6077<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
6078<method-group name="public static functions">
6079<method name="container_from_end_iterator" specifiers="static"><type><classname>splay_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
6080<method name="container_from_end_iterator" specifiers="static"><type>const <classname>splay_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
6081<method name="container_from_iterator" specifiers="static"><type><classname>splay_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
6082<method name="container_from_iterator" specifiers="static"><type>const <classname>splay_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
6083<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
6084<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
6085<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
6086</method-group>
6087</class><class name="splay_set"><template>
6088      <template-type-parameter name="T"/>
6089      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6090    </template><description><para>The class template <classname alt="boost::intrusive::splay_set">splay_set</classname> is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
6091<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
6092<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
6093<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
6094<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
6095<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
6096<typedef name="reference"><type>implementation_defined::reference</type></typedef>
6097<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
6098<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
6099<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
6100<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
6101<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
6102<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
6103<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
6104<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
6105<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
6106<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
6107<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
6108<typedef name="node"><type>implementation_defined::node</type></typedef>
6109<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
6110<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
6111<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
6112<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
6113<method-group name="public member functions">
6114<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6115<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6116<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6117<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6118<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6119<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6120<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6121<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6122<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6123<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6124<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6125<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6126<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6127<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6128<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6129<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
6130<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
6131<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6132<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6133<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>splay_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
6134<method name="clone_from"><type>void</type><template>
6135          <template-type-parameter name="Cloner"/>
6136          <template-type-parameter name="Disposer"/>
6137        </template><parameter name="src"><paramtype>const <classname>splay_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
6138<method name="clone_from"><type>void</type><template>
6139          <template-type-parameter name="Cloner"/>
6140          <template-type-parameter name="Disposer"/>
6141        </template><parameter name="src"><paramtype><classname>splay_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
6142<method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6143<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6144<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
6145<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
6146<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
6147          <template-type-parameter name="KeyType"/>
6148          <template-type-parameter name="KeyTypeKeyCompare"/>
6149        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
6150<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
6151          <template-type-parameter name="KeyType"/>
6152          <template-type-parameter name="KeyTypeKeyCompare"/>
6153        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
6154<method name="insert"><type>void</type><template>
6155          <template-type-parameter name="Iterator"/>
6156        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6157<method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
6158<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
6159<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
6160<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
6161<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6162<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6163<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6164<method name="erase"><type>size_type</type><template>
6165          <template-type-parameter name="KeyType"/>
6166          <template-type-parameter name="KeyTypeKeyCompare"/>
6167        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6168<method name="erase_and_dispose"><type>iterator</type><template>
6169          <template-type-parameter name="Disposer"/>
6170        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
6171<method name="erase_and_dispose"><type>iterator</type><template>
6172          <template-type-parameter name="Disposer"/>
6173        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
6174<method name="erase_and_dispose"><type>size_type</type><template>
6175          <template-type-parameter name="Disposer"/>
6176        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6177<method name="erase_and_dispose"><type>size_type</type><template>
6178          <template-type-parameter name="KeyType"/>
6179          <template-type-parameter name="KeyTypeKeyCompare"/>
6180          <template-type-parameter name="Disposer"/>
6181        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
6182<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6183<method name="clear_and_dispose"><type>void</type><template>
6184          <template-type-parameter name="Disposer"/>
6185        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
6186<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6187<method name="count" cv="const"><type>size_type</type><template>
6188          <template-type-parameter name="KeyType"/>
6189          <template-type-parameter name="KeyTypeKeyCompare"/>
6190        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6191<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6192<method name="count" cv="const"><type>size_type</type><template>
6193          <template-type-parameter name="KeyType"/>
6194          <template-type-parameter name="KeyTypeKeyCompare"/>
6195        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6196<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
6197<method name="lower_bound"><type>iterator</type><template>
6198          <template-type-parameter name="KeyType"/>
6199          <template-type-parameter name="KeyTypeKeyCompare"/>
6200        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6201<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6202<method name="lower_bound" cv="const"><type>const_iterator</type><template>
6203          <template-type-parameter name="KeyType"/>
6204          <template-type-parameter name="KeyTypeKeyCompare"/>
6205        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6206<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
6207<method name="upper_bound"><type>iterator</type><template>
6208          <template-type-parameter name="KeyType"/>
6209          <template-type-parameter name="KeyTypeKeyCompare"/>
6210        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6211<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6212<method name="upper_bound" cv="const"><type>const_iterator</type><template>
6213          <template-type-parameter name="KeyType"/>
6214          <template-type-parameter name="KeyTypeKeyCompare"/>
6215        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6216<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
6217<method name="find"><type>iterator</type><template>
6218          <template-type-parameter name="KeyType"/>
6219          <template-type-parameter name="KeyTypeKeyCompare"/>
6220        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6221<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6222<method name="find" cv="const"><type>const_iterator</type><template>
6223          <template-type-parameter name="KeyType"/>
6224          <template-type-parameter name="KeyTypeKeyCompare"/>
6225        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6226<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6227<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
6228          <template-type-parameter name="KeyType"/>
6229          <template-type-parameter name="KeyTypeKeyCompare"/>
6230        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
6231<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6232<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
6233          <template-type-parameter name="KeyType"/>
6234          <template-type-parameter name="KeyTypeKeyCompare"/>
6235        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
6236<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6237<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
6238          <template-type-parameter name="KeyType"/>
6239          <template-type-parameter name="KeyTypeKeyCompare"/>
6240        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6241<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6242<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
6243          <template-type-parameter name="KeyType"/>
6244          <template-type-parameter name="KeyTypeKeyCompare"/>
6245        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6246<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6247<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6248<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
6249<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
6250<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
6251<method name="splay_up"><type>void</type><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: i must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that the element pointed by i is placed as the root of the tree, improving future searches of this value.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6252<method name="splay_down"><type>iterator</type><template>
6253          <template-type-parameter name="KeyType"/>
6254          <template-type-parameter name="KeyTypeKeyCompare"/>
6255        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree. If the element is not present returns the last node compared with the key. If the tree is empty, end() is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor throws. </para></description></method>
6256<method name="splay_down"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. </para></description></method>
6257<method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
6258<method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
6259<method name="merge"><type>void</type><template>
6260          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
6261        </template><parameter name="source"><paramtype><classname>splay_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
6262<method name="merge"><type>void</type><template>
6263          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
6264        </template><parameter name="source"><paramtype><classname>splay_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
6265</method-group>
6266<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
6267<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
6268<constructor><template>
6269          <template-type-parameter name="Iterator"/>
6270        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
6271<constructor><parameter name="x"><paramtype><classname>splay_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
6272<copy-assignment><type><classname>splay_set</classname> &amp;</type><parameter name="x"><paramtype><classname>splay_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
6273<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
6274<method-group name="public static functions">
6275<method name="container_from_end_iterator" specifiers="static"><type><classname>splay_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
6276<method name="container_from_end_iterator" specifiers="static"><type>const <classname>splay_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
6277<method name="container_from_iterator" specifiers="static"><type><classname>splay_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
6278<method name="container_from_iterator" specifiers="static"><type>const <classname>splay_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
6279<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
6280<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
6281<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
6282</method-group>
6283</class><function name="operator!="><type>bool</type><template>
6284          <template-type-parameter name="T"/>
6285          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6286        </template><parameter name="x"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6287<function name="operator&gt;"><type>bool</type><template>
6288          <template-type-parameter name="T"/>
6289          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6290        </template><parameter name="x"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6291<function name="operator&lt;="><type>bool</type><template>
6292          <template-type-parameter name="T"/>
6293          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6294        </template><parameter name="x"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6295<function name="operator&gt;="><type>bool</type><template>
6296          <template-type-parameter name="T"/>
6297          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6298        </template><parameter name="x"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6299<function name="swap"><type>void</type><template>
6300          <template-type-parameter name="T"/>
6301          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6302        </template><parameter name="x"><paramtype><classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6303<function name="operator!="><type>bool</type><template>
6304          <template-type-parameter name="T"/>
6305          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6306        </template><parameter name="x"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6307<function name="operator&gt;"><type>bool</type><template>
6308          <template-type-parameter name="T"/>
6309          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6310        </template><parameter name="x"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6311<function name="operator&lt;="><type>bool</type><template>
6312          <template-type-parameter name="T"/>
6313          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6314        </template><parameter name="x"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6315<function name="operator&gt;="><type>bool</type><template>
6316          <template-type-parameter name="T"/>
6317          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6318        </template><parameter name="x"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6319<function name="swap"><type>void</type><template>
6320          <template-type-parameter name="T"/>
6321          <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6322        </template><parameter name="x"><paramtype><classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365</namespace>
6366</namespace>
6367</header>
6368<header name="boost/intrusive/splaytree.hpp">
6369<namespace name="boost">
6370<namespace name="intrusive">
6371<struct name="make_splaytree"><template>
6372      <template-type-parameter name="T"/>
6373      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6374    </template><description><para>Helper metafunction to define a <computeroutput>splaytree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
6375</struct><class name="splaytree"><template>
6376      <template-type-parameter name="T"/>
6377      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6378    </template><description><para>The class template splaytree is an intrusive splay tree container that is used to construct intrusive <classname alt="boost::intrusive::splay_set">splay_set</classname> and <classname alt="boost::intrusive::splay_multiset">splay_multiset</classname> containers. The no-throw guarantee holds only, if the key_compare object doesn't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
6379<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
6380<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
6381<typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
6382<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
6383<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
6384<typedef name="reference"><type>implementation_defined::reference</type></typedef>
6385<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
6386<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
6387<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
6388<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
6389<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
6390<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
6391<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
6392<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
6393<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
6394<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
6395<typedef name="node"><type>implementation_defined::node</type></typedef>
6396<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
6397<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
6398<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
6399<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
6400<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
6401<method-group name="public member functions">
6402<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6403<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6404<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6405<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6406<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6407<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6408<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6409<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6410<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6411<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6412<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6413<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6414<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6415<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6416<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6417<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
6418<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
6419<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6420<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6421<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>splaytree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
6422<method name="clone_from"><type>void</type><template>
6423          <template-type-parameter name="Cloner"/>
6424          <template-type-parameter name="Disposer"/>
6425        </template><parameter name="src"><paramtype>const <classname>splaytree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
6426<method name="clone_from"><type>void</type><template>
6427          <template-type-parameter name="Cloner"/>
6428          <template-type-parameter name="Disposer"/>
6429        </template><parameter name="src"><paramtype><classname>splaytree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
6430<method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6431<method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6432<method name="insert_equal"><type>void</type><template>
6433          <template-type-parameter name="Iterator"/>
6434        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6435<method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6436<method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6437<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
6438<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
6439<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
6440          <template-type-parameter name="KeyType"/>
6441          <template-type-parameter name="KeyTypeKeyCompare"/>
6442        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
6443<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
6444          <template-type-parameter name="KeyType"/>
6445          <template-type-parameter name="KeyTypeKeyCompare"/>
6446        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
6447<method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
6448<method name="insert_unique"><type>void</type><template>
6449          <template-type-parameter name="Iterator"/>
6450        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6451<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
6452<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
6453<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
6454<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6455<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6456<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6457<method name="erase"><type>size_type</type><template>
6458          <template-type-parameter name="KeyType"/>
6459          <template-type-parameter name="KeyTypeKeyCompare"/>
6460        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6461<method name="erase_and_dispose"><type>iterator</type><template>
6462          <template-type-parameter name="Disposer"/>
6463        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
6464<method name="erase_and_dispose"><type>iterator</type><template>
6465          <template-type-parameter name="Disposer"/>
6466        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
6467<method name="erase_and_dispose"><type>size_type</type><template>
6468          <template-type-parameter name="Disposer"/>
6469        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6470<method name="erase_and_dispose"><type>size_type</type><template>
6471          <template-type-parameter name="KeyType"/>
6472          <template-type-parameter name="KeyTypeKeyCompare"/>
6473          <template-type-parameter name="Disposer"/>
6474        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
6475<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6476<method name="clear_and_dispose"><type>void</type><template>
6477          <template-type-parameter name="Disposer"/>
6478        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
6479<method name="count"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
6480<method name="count"><type>size_type</type><template>
6481          <template-type-parameter name="KeyType"/>
6482          <template-type-parameter name="KeyTypeKeyCompare"/>
6483        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
6484<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6485<method name="count" cv="const"><type>size_type</type><template>
6486          <template-type-parameter name="KeyType"/>
6487          <template-type-parameter name="KeyTypeKeyCompare"/>
6488        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6489<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
6490<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6491<method name="lower_bound"><type>iterator</type><template>
6492          <template-type-parameter name="KeyType"/>
6493          <template-type-parameter name="KeyTypeKeyCompare"/>
6494        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6495<method name="lower_bound" cv="const"><type>const_iterator</type><template>
6496          <template-type-parameter name="KeyType"/>
6497          <template-type-parameter name="KeyTypeKeyCompare"/>
6498        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6499<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
6500<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6501<method name="upper_bound"><type>iterator</type><template>
6502          <template-type-parameter name="KeyType"/>
6503          <template-type-parameter name="KeyTypeKeyCompare"/>
6504        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6505<method name="upper_bound" cv="const"><type>const_iterator</type><template>
6506          <template-type-parameter name="KeyType"/>
6507          <template-type-parameter name="KeyTypeKeyCompare"/>
6508        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6509<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
6510<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6511<method name="find"><type>iterator</type><template>
6512          <template-type-parameter name="KeyType"/>
6513          <template-type-parameter name="KeyTypeKeyCompare"/>
6514        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6515<method name="find" cv="const"><type>const_iterator</type><template>
6516          <template-type-parameter name="KeyType"/>
6517          <template-type-parameter name="KeyTypeKeyCompare"/>
6518        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6519<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
6520<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6521<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
6522          <template-type-parameter name="KeyType"/>
6523          <template-type-parameter name="KeyTypeKeyCompare"/>
6524        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
6525<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
6526          <template-type-parameter name="KeyType"/>
6527          <template-type-parameter name="KeyTypeKeyCompare"/>
6528        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
6529<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6530<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
6531          <template-type-parameter name="KeyType"/>
6532          <template-type-parameter name="KeyTypeKeyCompare"/>
6533        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6534<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6535<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
6536          <template-type-parameter name="KeyType"/>
6537          <template-type-parameter name="KeyTypeKeyCompare"/>
6538        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
6539<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6540<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6541<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
6542<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
6543<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
6544<method name="merge_unique"><type>void</type><template>
6545          <template-type-parameter name="T"/>
6546          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
6547        </template><parameter name=""><paramtype><classname>splaytree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
6548<method name="merge_equal"><type>void</type><template>
6549          <template-type-parameter name="T"/>
6550          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
6551        </template><parameter name=""><paramtype><classname>splaytree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
6552<method name="splay_up"><type>void</type><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: i must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that the element pointed by i is placed as the root of the tree, improving future searches of this value.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6553<method name="splay_down"><type>iterator</type><template>
6554          <template-type-parameter name="KeyType"/>
6555          <template-type-parameter name="KeyTypeKeyCompare"/>
6556        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree. If the element is not present returns the last node compared with the key. If the tree is empty, end() is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor throws. </para></description></method>
6557<method name="splay_down"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. </para></description></method>
6558<method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
6559<method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
6560</method-group>
6561<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
6562<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
6563<constructor><template>
6564          <template-type-parameter name="Iterator"/>
6565        </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
6566<constructor><parameter name="x"><paramtype><classname>splaytree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
6567<copy-assignment><type><classname>splaytree</classname> &amp;</type><parameter name="x"><paramtype><classname>splaytree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
6568<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
6569<method-group name="public static functions">
6570<method name="container_from_end_iterator" specifiers="static"><type><classname>splaytree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
6571<method name="container_from_end_iterator" specifiers="static"><type>const <classname>splaytree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
6572<method name="container_from_iterator" specifiers="static"><type><classname>splaytree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
6573<method name="container_from_iterator" specifiers="static"><type>const <classname>splaytree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
6574<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
6575<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
6576<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
6577</method-group>
6578</class>
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630</namespace>
6631</namespace>
6632</header>
6633<header name="boost/intrusive/splaytree_algorithms.hpp">
6634<namespace name="boost">
6635<namespace name="intrusive">
6636<class name="splaytree_algorithms"><template>
6637      <template-type-parameter name="NodeTraits"/>
6638    </template><description><para>A splay tree is an implementation of a binary search tree. The tree is self balancing using the splay algorithm as described in</para><para>"Self-Adjusting Binary Search Trees by Daniel Dominic Sleator and Robert Endre Tarjan AT&amp;T Bell Laboratories, Murray Hill, NJ Journal of the ACM, Vol 32, no 3, July 1985, pp 652-686</para><para><classname alt="boost::intrusive::splaytree_algorithms">splaytree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
6639<typedef name="node_traits"><type>NodeTraits</type></typedef>
6640<typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
6641<typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
6642<typedef name="insert_commit_data"><description><para>This type is the information that will be filled by insert_unique_check </para></description><type>bstree_algo::insert_commit_data</type></typedef>
6643<method-group name="public static functions">
6644<method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6645<method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6646<method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6647<method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="header2"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6648<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
6649<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
6650<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
6651<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
6652<method name="unlink" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6653<method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
6654<method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6655<method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6656<method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6657<method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6658<method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
6659<method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
6660<method name="erase" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. Additional notes: the previous node of z is splayed to speed up range deletions. </para></description></method>
6661<method name="transfer_unique" specifiers="static"><type>bool</type><template>
6662          <template-type-parameter name="NodePtrCompare"/>
6663        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
6664<method name="transfer_equal" specifiers="static"><type>void</type><template>
6665          <template-type-parameter name="NodePtrCompare"/>
6666        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
6667<method name="clone" specifiers="static"><type>void</type><template>
6668          <template-type-parameter name="Cloner"/>
6669          <template-type-parameter name="Disposer"/>
6670        </template><parameter name="source_header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
6671<method name="clear_and_dispose" specifiers="static"><type>void</type><template>
6672          <template-type-parameter name="Disposer"/>
6673        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
6674<method name="count" specifiers="static"><type>std::size_t</type><template>
6675          <template-type-parameter name="KeyType"/>
6676          <template-type-parameter name="KeyNodePtrCompare"/>
6677        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: an element with key <computeroutput>key</computeroutput> is splayed. </para></description></method>
6678<method name="count" specifiers="static"><type>std::size_t</type><template>
6679          <template-type-parameter name="KeyType"/>
6680          <template-type-parameter name="KeyNodePtrCompare"/>
6681        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
6682<method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
6683          <template-type-parameter name="KeyType"/>
6684          <template-type-parameter name="KeyNodePtrCompare"/>
6685        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the first node of the range is splayed. </para></description></method>
6686<method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
6687          <template-type-parameter name="KeyType"/>
6688          <template-type-parameter name="KeyNodePtrCompare"/>
6689        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
6690<method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
6691          <template-type-parameter name="KeyType"/>
6692          <template-type-parameter name="KeyNodePtrCompare"/>
6693        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the first node of the range is splayed. </para></description></method>
6694<method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
6695          <template-type-parameter name="KeyType"/>
6696          <template-type-parameter name="KeyNodePtrCompare"/>
6697        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
6698<method name="find" specifiers="static"><type>node_ptr</type><template>
6699          <template-type-parameter name="KeyType"/>
6700          <template-type-parameter name="KeyNodePtrCompare"/>
6701        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the found node of the lower bound is splayed. </para></description></method>
6702<method name="find" specifiers="static"><type>node_ptr</type><template>
6703          <template-type-parameter name="KeyType"/>
6704          <template-type-parameter name="KeyNodePtrCompare"/>
6705        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
6706<method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
6707          <template-type-parameter name="KeyType"/>
6708          <template-type-parameter name="KeyNodePtrCompare"/>
6709        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the first node of the range is splayed. </para></description></method>
6710<method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
6711          <template-type-parameter name="KeyType"/>
6712          <template-type-parameter name="KeyNodePtrCompare"/>
6713        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
6714<method name="lower_bound_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
6715          <template-type-parameter name="KeyType"/>
6716          <template-type-parameter name="KeyNodePtrCompare"/>
6717        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing the first element that is equivalent to "key" according to "comp" or an empty range that indicates the position where that element would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the first node of the range is splayed. </para></description></method>
6718<method name="lower_bound_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
6719          <template-type-parameter name="KeyType"/>
6720          <template-type-parameter name="KeyNodePtrCompare"/>
6721        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing the first element that is equivalent to "key" according to "comp" or an empty range that indicates the position where that element would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
6722<method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
6723          <template-type-parameter name="KeyType"/>
6724          <template-type-parameter name="KeyNodePtrCompare"/>
6725        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. Additional notes: the first node of the range is splayed. </para></description></method>
6726<method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
6727          <template-type-parameter name="KeyType"/>
6728          <template-type-parameter name="KeyNodePtrCompare"/>
6729        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. Additional note: no splaying is performed </para></description></method>
6730<method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
6731          <template-type-parameter name="NodePtrCompare"/>
6732        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: the inserted node is splayed </para></description></method>
6733<method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
6734          <template-type-parameter name="NodePtrCompare"/>
6735        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: the inserted node is splayed </para></description></method>
6736<method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
6737          <template-type-parameter name="NodePtrCompare"/>
6738        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: the inserted node is splayed </para></description></method>
6739<method name="insert_before" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. Additional note: the inserted node is splayed </para></description></method>
6740<method name="push_back" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". Additional note: the inserted node is splayed </para></description></method>
6741<method name="push_front" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". Additional note: the inserted node is splayed </para></description></method>
6742<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
6743          <template-type-parameter name="KeyType"/>
6744          <template-type-parameter name="KeyNodePtrCompare"/>
6745        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. Additional note: nodes with the given key are splayed </para></description></method>
6746<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
6747          <template-type-parameter name="KeyType"/>
6748          <template-type-parameter name="KeyNodePtrCompare"/>
6749        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. Additional note: nodes with the given key are splayed </para></description></method>
6750<method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
6751<method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6752<method name="rebalance" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
6753<method name="rebalance_subtree" specifiers="static"><type>node_ptr</type><parameter name="old_root"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree. It shall not be null.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
6754<method name="splay_up" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter></method>
6755<method name="splay_down" specifiers="static"><type>node_ptr</type><template>
6756          <template-type-parameter name="KeyType"/>
6757          <template-type-parameter name="KeyNodePtrCompare"/>
6758        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="pfound"><paramtype>bool *</paramtype><default>0</default></parameter></method>
6759</method-group>
6760</class>
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812</namespace>
6813</namespace>
6814</header>
6815<header name="boost/intrusive/treap.hpp">
6816<namespace name="boost">
6817<namespace name="intrusive">
6818<struct name="make_treap"><template>
6819      <template-type-parameter name="T"/>
6820      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6821    </template><description><para>Helper metafunction to define a <computeroutput>treap</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="packed_options"><type><classname>pack_options</classname>&lt; treap_defaults, O1, O2, O3, O4, O5, O6, O7 &gt;::<classname>type</classname></type></typedef>
6822<typedef name="value_traits"><type><emphasis>unspecified</emphasis></type></typedef>
6823<typedef name="implementation_defined"><type><classname>treap</classname>&lt; value_traits, typename packed_options::key_of_value, typename packed_options::compare, typename packed_options::priority_of_value, typename packed_options::priority, typename packed_options::size_type, packed_options::constant_time_size, typename packed_options::header_holder_type &gt;</type></typedef>
6824<typedef name="type"><type><classname>implementation_defined</classname></type></typedef>
6825</struct><class name="treap"><template>
6826      <template-type-parameter name="T"/>
6827      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
6828    </template><description><para>The class template treap is an intrusive treap container that is used to construct intrusive set and multiset containers. The no-throw guarantee holds only, if the key_compare object and priority_compare object don't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>compare&lt;&gt;</computeroutput>, <computeroutput>priority&lt;&gt;</computeroutput> and <computeroutput>priority_of_value&lt;&gt;</computeroutput> </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
6829<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
6830<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
6831<typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
6832<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
6833<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
6834<typedef name="reference"><type>implementation_defined::reference</type></typedef>
6835<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
6836<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
6837<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
6838<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
6839<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
6840<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
6841<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
6842<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
6843<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
6844<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
6845<typedef name="node"><type>implementation_defined::node</type></typedef>
6846<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
6847<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
6848<typedef name="node_algorithms"><type>implementation_defined</type></typedef>
6849<typedef name="priority_type"><type>implementation_defined</type></typedef>
6850<typedef name="priority_of_value"><type>implementation_defined</type></typedef>
6851<typedef name="priority_compare"><type>implementation_defined</type></typedef>
6852<typedef name="prio_node_prio_comp_t"><type><emphasis>unspecified</emphasis></type></typedef>
6853<typedef name="insert_commit_data"><type>node_algorithms::insert_commit_data</type></typedef>
6854<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
6855<data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
6856<data-member name="safemode_or_autounlink" specifiers="static"><type>const bool</type></data-member>
6857<method-group name="public member functions">
6858<method name="prio_node_prio_comp" cv="const"><type><emphasis>unspecified</emphasis></type><template>
6859          <template-type-parameter name="PrioPrioComp"/>
6860        </template><parameter name="priopriocomp"><paramtype>PrioPrioComp</paramtype></parameter></method>
6861<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6862<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6863<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6864<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6865<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6866<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6867<method name="top"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the highest priority object of the treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6868<method name="top" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6869<method name="ctop" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6870<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6871<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6872<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6873<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6874<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6875<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6876<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6877<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6878<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6879<method name="rtop"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6880<method name="rtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6881<method name="crtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6882<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
6883<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
6884<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6885<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
6886<method name="priority_comp" cv="const"><type>priority_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the priority_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If priority_compare copy-constructor throws. </para></description></method>
6887<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>treap</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two treaps.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
6888<method name="clone_from"><type>void</type><template>
6889          <template-type-parameter name="Cloner"/>
6890          <template-type-parameter name="Disposer"/>
6891        </template><parameter name="src"><paramtype>const <classname>treap</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
6892<method name="clone_from"><type>void</type><template>
6893          <template-type-parameter name="Cloner"/>
6894          <template-type-parameter name="Disposer"/>
6895        </template><parameter name="src"><paramtype><classname>treap</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
6896<method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6897<method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6898<method name="insert_equal"><type>void</type><template>
6899          <template-type-parameter name="Iterator"/>
6900        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by key_comp().</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6901<method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6902<method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6903<method name="insert_unique"><type>void</type><template>
6904          <template-type-parameter name="Iterator"/>
6905        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by key_comp().</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
6906<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="prio"><paramtype>const priority_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison or predicate functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
6907<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="prio"><paramtype>const priority_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison or predicate functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
6908<method name="insert_unique_check"><type>std::pair&lt; iterator BOOST_INTRUSIVE_I bool &gt;</type><template>
6909          <template-type-parameter name="KeyType"/>
6910          <template-type-parameter name="KeyTypeKeyCompare"/>
6911          <template-type-parameter name="PrioType"/>
6912          <template-type-parameter name="PrioValuePrioCompare"/>
6913        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="prio_value_pcomp"><paramtype>PrioValuePrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. prio_value_pcomp must be a comparison function that induces the same strict weak ordering as priority_compare. The difference is that prio_value_pcomp and comp compare an arbitrary key/priority with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp or prio_value_pcomp ordering functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
6914<method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
6915          <template-type-parameter name="KeyType"/>
6916          <template-type-parameter name="KeyTypeKeyCompare"/>
6917          <template-type-parameter name="PrioType"/>
6918          <template-type-parameter name="PrioValuePrioCompare"/>
6919        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="prio_value_pcomp"><paramtype>PrioValuePrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. prio_value_pcomp must be a comparison function that induces the same strict weak ordering as priority_compare. The difference is that prio_value_pcomp and comp compare an arbitrary key/priority with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp or prio_value_pcomp ordering functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
6920<method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the <classname alt="boost::intrusive::avl_set">avl_set</classname> using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
6921<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
6922<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
6923<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
6924<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6925<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6926<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6927<method name="erase"><type>size_type</type><template>
6928          <template-type-parameter name="KeyType"/>
6929          <template-type-parameter name="KeyTypeKeyCompare"/>
6930        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Equivalent guarantee to <emphasis>while(beg != end) erase(beg++);</emphasis></para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6931<method name="erase_and_dispose"><type>iterator</type><template>
6932          <template-type-parameter name="Disposer"/>
6933        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
6934<method name="erase_and_dispose"><type>iterator</type><template>
6935          <template-type-parameter name="Disposer"/>
6936        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
6937<method name="erase_and_dispose"><type>size_type</type><template>
6938          <template-type-parameter name="Disposer"/>
6939        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6940<method name="erase_and_dispose"><type>size_type</type><template>
6941          <template-type-parameter name="KeyType"/>
6942          <template-type-parameter name="KeyTypeKeyCompare"/>
6943          <template-type-parameter name="Disposer"/>
6944        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
6945<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
6946<method name="clear_and_dispose"><type>void</type><template>
6947          <template-type-parameter name="Disposer"/>
6948        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
6949<method name="merge_unique"><type>void</type><template>
6950          <template-type-parameter name="T"/>
6951          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
6952        </template><parameter name=""><paramtype><classname>sgtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
6953<method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
6954<method name="merge_equal"><type>void</type><template>
6955          <template-type-parameter name="T"/>
6956          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
6957        </template><parameter name=""><paramtype><classname>sgtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
6958<method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
6959<method name="check" cv="const"><type>void</type><template>
6960          <template-type-parameter name="ExtraChecker"/>
6961        </template><parameter name="extra_checker"><paramtype>ExtraChecker</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container with additional checks provided by the user.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
6962<method name="check" cv="const"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
6963<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6964<method name="count" cv="const"><type>size_type</type><template>
6965          <template-type-parameter name="KeyType"/>
6966          <template-type-parameter name="KeyTypeKeyCompare"/>
6967        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
6968<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6969<method name="lower_bound"><type>iterator</type><template>
6970          <template-type-parameter name="KeyType"/>
6971          <template-type-parameter name="KeyTypeKeyCompare"/>
6972        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6973<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6974<method name="lower_bound" cv="const"><type>const_iterator</type><template>
6975          <template-type-parameter name="KeyType"/>
6976          <template-type-parameter name="KeyTypeKeyCompare"/>
6977        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6978<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6979<method name="upper_bound"><type>iterator</type><template>
6980          <template-type-parameter name="KeyType"/>
6981          <template-type-parameter name="KeyTypeKeyCompare"/>
6982        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
6983<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6984<method name="upper_bound" cv="const"><type>const_iterator</type><template>
6985          <template-type-parameter name="KeyType"/>
6986          <template-type-parameter name="KeyTypeKeyCompare"/>
6987        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
6988<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6989<method name="find"><type>iterator</type><template>
6990          <template-type-parameter name="KeyType"/>
6991          <template-type-parameter name="KeyTypeKeyCompare"/>
6992        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
6993<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6994<method name="find" cv="const"><type>const_iterator</type><template>
6995          <template-type-parameter name="KeyType"/>
6996          <template-type-parameter name="KeyTypeKeyCompare"/>
6997        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
6998<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
6999<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
7000          <template-type-parameter name="KeyType"/>
7001          <template-type-parameter name="KeyTypeKeyCompare"/>
7002        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7003<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7004<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
7005          <template-type-parameter name="KeyType"/>
7006          <template-type-parameter name="KeyTypeKeyCompare"/>
7007        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7008<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7009<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
7010          <template-type-parameter name="KeyType"/>
7011          <template-type-parameter name="KeyTypeKeyCompare"/>
7012        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7013<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7014<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
7015          <template-type-parameter name="KeyType"/>
7016          <template-type-parameter name="KeyTypeKeyCompare"/>
7017        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7018<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7019<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7020<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
7021<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
7022<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
7023</method-group>
7024<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
7025<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
7026<constructor><template>
7027          <template-type-parameter name="Iterator"/>
7028        </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
7029<constructor><parameter name="x"><paramtype><classname>treap</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
7030<copy-assignment><type><classname>treap</classname> &amp;</type><parameter name="x"><paramtype><classname>treap</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
7031<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
7032<method-group name="public static functions">
7033<method name="container_from_end_iterator" specifiers="static"><type><classname>treap</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
7034<method name="container_from_end_iterator" specifiers="static"><type>const <classname>treap</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
7035<method name="container_from_iterator" specifiers="static"><type><classname>treap</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
7036<method name="container_from_iterator" specifiers="static"><type>const <classname>treap</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
7037<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
7038<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
7039<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
7040</method-group>
7041</class>
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093</namespace>
7094</namespace>
7095</header>
7096<header name="boost/intrusive/treap_algorithms.hpp">
7097<namespace name="boost">
7098<namespace name="intrusive">
7099<class name="treap_algorithms"><template>
7100      <template-type-parameter name="NodeTraits"/>
7101    </template><description><para><classname alt="boost::intrusive::treap_algorithms">treap_algorithms</classname> provides basic algorithms to manipulate nodes forming a treap.</para><para>(1) the header node is maintained with links not only to the root but also to the leftmost node of the tree, to enable constant time begin(), and to the rightmost node of the tree, to enable linear time performance when used with the generic set algorithms (set_union, etc.);</para><para>(2) when a node being deleted has two children its successor node is relinked into its place, rather than copied, so that the only pointers invalidated are those referring to the deleted node.</para><para><classname alt="boost::intrusive::treap_algorithms">treap_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the treap</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput> </para></description><struct name="insert_commit_data"><description><para>This type is the information that will be filled by insert_unique_check </para></description></struct><typedef name="node_traits"><type>NodeTraits</type></typedef>
7102<typedef name="node"><type>NodeTraits::node</type></typedef>
7103<typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
7104<typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
7105<method-group name="public static functions">
7106<method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7107<method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7108<method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7109<method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7110<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
7111<method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
7112<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
7113<method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
7114<method name="unlink" specifiers="static"><type>void</type><template>
7115          <template-type-parameter name="NodePtrPriorityCompare"/>
7116        </template><parameter name="node"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7117<method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
7118<method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7119<method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7120<method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7121<method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7122<method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
7123<method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
7124<method name="erase" specifiers="static"><type>node_ptr</type><template>
7125          <template-type-parameter name="NodePtrPriorityCompare"/>
7126        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7127<method name="clone" specifiers="static"><type>void</type><template>
7128          <template-type-parameter name="Cloner"/>
7129          <template-type-parameter name="Disposer"/>
7130        </template><parameter name="source_header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
7131<method name="clear_and_dispose" specifiers="static"><type>void</type><template>
7132          <template-type-parameter name="Disposer"/>
7133        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
7134<method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
7135          <template-type-parameter name="KeyType"/>
7136          <template-type-parameter name="KeyNodePtrCompare"/>
7137        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
7138<method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
7139          <template-type-parameter name="KeyType"/>
7140          <template-type-parameter name="KeyNodePtrCompare"/>
7141        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
7142<method name="find" specifiers="static"><type>node_ptr</type><template>
7143          <template-type-parameter name="KeyType"/>
7144          <template-type-parameter name="KeyNodePtrCompare"/>
7145        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
7146<method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
7147          <template-type-parameter name="KeyType"/>
7148          <template-type-parameter name="KeyNodePtrCompare"/>
7149        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
7150<method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
7151          <template-type-parameter name="KeyType"/>
7152          <template-type-parameter name="KeyNodePtrCompare"/>
7153        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
7154<method name="count" specifiers="static"><type>std::size_t</type><template>
7155          <template-type-parameter name="KeyType"/>
7156          <template-type-parameter name="KeyNodePtrCompare"/>
7157        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
7158<method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
7159          <template-type-parameter name="NodePtrCompare"/>
7160          <template-type-parameter name="NodePtrPriorityCompare"/>
7161        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp" and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throw or "pcomp" throw. </para></description></method>
7162<method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
7163          <template-type-parameter name="NodePtrCompare"/>
7164          <template-type-parameter name="NodePtrPriorityCompare"/>
7165        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp" and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
7166<method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
7167          <template-type-parameter name="NodePtrCompare"/>
7168          <template-type-parameter name="NodePtrPriorityCompare"/>
7169        </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case). Rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throw or "pcomp" throw. </para></description></method>
7170<method name="insert_before" specifiers="static"><type>node_ptr</type><template>
7171          <template-type-parameter name="NodePtrPriorityCompare"/>
7172        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid node of the tree (including header end) node. "pos" must be a node pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos" and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: If "pcomp" throws, strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
7173<method name="push_back" specifiers="static"><type>void</type><template>
7174          <template-type-parameter name="NodePtrPriorityCompare"/>
7175        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the tree in the last position and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: If "pcomp" throws, strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
7176<method name="push_front" specifiers="static"><type>void</type><template>
7177          <template-type-parameter name="NodePtrPriorityCompare"/>
7178        </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the tree in the first position and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: If "pcomp" throws, strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
7179<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
7180          <template-type-parameter name="KeyType"/>
7181          <template-type-parameter name="KeyNodePtrCompare"/>
7182          <template-type-parameter name="PrioType"/>
7183          <template-type-parameter name="PrioNodePtrPrioCompare"/>
7184        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="pcomp"><paramtype>PrioNodePtrPrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype><classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
7185<method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
7186          <template-type-parameter name="KeyType"/>
7187          <template-type-parameter name="KeyNodePtrCompare"/>
7188          <template-type-parameter name="PrioType"/>
7189          <template-type-parameter name="PrioNodePtrPrioCompare"/>
7190        </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="pcomp"><paramtype>PrioNodePtrPrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype><classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
7191<method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const <classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
7192<method name="transfer_unique" specifiers="static"><type>bool</type><template>
7193          <template-type-parameter name="NodePtrCompare"/>
7194          <template-type-parameter name="PrioNodePtrPrioCompare"/>
7195        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>PrioNodePtrPrioCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
7196<method name="transfer_equal" specifiers="static"><type>void</type><template>
7197          <template-type-parameter name="NodePtrCompare"/>
7198          <template-type-parameter name="PrioNodePtrPrioCompare"/>
7199        </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>PrioNodePtrPrioCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
7200<method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7201</method-group>
7202</class>
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254</namespace>
7255</namespace>
7256</header>
7257<header name="boost/intrusive/treap_set.hpp">
7258<namespace name="boost">
7259<namespace name="intrusive">
7260<struct name="make_treap_multiset"><template>
7261      <template-type-parameter name="T"/>
7262      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
7263    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::treap_multiset">treap_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="packed_options"><type><classname>pack_options</classname>&lt; treap_defaults, O1, O2, O3, O4, O5, O6, O7 &gt;::<classname>type</classname></type></typedef>
7264<typedef name="value_traits"><type><emphasis>unspecified</emphasis></type></typedef>
7265<typedef name="implementation_defined"><type><classname>treap_multiset</classname>&lt; value_traits, typename packed_options::key_of_value, typename packed_options::compare, typename packed_options::priority_of_value, typename packed_options::priority, typename packed_options::size_type, packed_options::constant_time_size, typename packed_options::header_holder_type &gt;</type></typedef>
7266<typedef name="type"><type><classname>implementation_defined</classname></type></typedef>
7267</struct><struct name="make_treap_set"><template>
7268      <template-type-parameter name="T"/>
7269      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
7270    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::treap_set">treap_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="packed_options"><type><classname>pack_options</classname>&lt; treap_defaults, O1, O2, O3, O4, O5, O6, O7 &gt;::<classname>type</classname></type></typedef>
7271<typedef name="value_traits"><type><emphasis>unspecified</emphasis></type></typedef>
7272<typedef name="implementation_defined"><type><classname>treap_set</classname>&lt; value_traits, typename packed_options::key_of_value, typename packed_options::compare, typename packed_options::priority_of_value, typename packed_options::priority, typename packed_options::size_type, packed_options::constant_time_size, typename packed_options::header_holder_type &gt;</type></typedef>
7273<typedef name="type"><type><classname>implementation_defined</classname></type></typedef>
7274</struct><class name="treap_multiset"><template>
7275      <template-type-parameter name="T"/>
7276      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
7277    </template><description><para>The class template <classname alt="boost::intrusive::treap_multiset">treap_multiset</classname> is an intrusive container, that mimics most of the interface of std::treap_multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>compare&lt;&gt;</computeroutput>, <computeroutput>priority&lt;&gt;</computeroutput> and <computeroutput>priority_of_value&lt;&gt;</computeroutput> </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
7278<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
7279<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
7280<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
7281<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
7282<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
7283<typedef name="reference"><type>implementation_defined::reference</type></typedef>
7284<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
7285<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
7286<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
7287<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
7288<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
7289<typedef name="priority_type"><type>implementation_defined::priority_type</type></typedef>
7290<typedef name="priority_compare"><type>implementation_defined::priority_compare</type></typedef>
7291<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
7292<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
7293<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
7294<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
7295<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
7296<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
7297<typedef name="node"><type>implementation_defined::node</type></typedef>
7298<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
7299<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
7300<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
7301<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
7302<method-group name="public member functions">
7303<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7304<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7305<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7306<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7307<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7308<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7309<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7310<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7311<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7312<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7313<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7314<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7315<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7316<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7317<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7318<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
7319<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
7320<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7321<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7322<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>treap_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two treaps.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
7323<method name="clone_from"><type>void</type><template>
7324          <template-type-parameter name="Cloner"/>
7325          <template-type-parameter name="Disposer"/>
7326        </template><parameter name="src"><paramtype>const <classname>treap_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
7327<method name="clone_from"><type>void</type><template>
7328          <template-type-parameter name="Cloner"/>
7329          <template-type-parameter name="Disposer"/>
7330        </template><parameter name="src"><paramtype><classname>treap_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
7331<method name="top"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the highest priority object of the treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7332<method name="top" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7333<method name="ctop" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7334<method name="rtop"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7335<method name="rtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7336<method name="crtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7337<method name="priority_comp" cv="const"><type>priority_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7338<method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7339<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7340<method name="insert"><type>void</type><template>
7341          <template-type-parameter name="Iterator"/>
7342        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by key_comp().</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7343<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
7344<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
7345<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
7346<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7347<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7348<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7349<method name="erase"><type>size_type</type><template>
7350          <template-type-parameter name="KeyType"/>
7351          <template-type-parameter name="KeyTypeKeyCompare"/>
7352        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Equivalent guarantee to <emphasis>while(beg != end) erase(beg++);</emphasis></para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7353<method name="erase_and_dispose"><type>iterator</type><template>
7354          <template-type-parameter name="Disposer"/>
7355        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
7356<method name="erase_and_dispose"><type>iterator</type><template>
7357          <template-type-parameter name="Disposer"/>
7358        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
7359<method name="erase_and_dispose"><type>size_type</type><template>
7360          <template-type-parameter name="Disposer"/>
7361        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7362<method name="erase_and_dispose"><type>size_type</type><template>
7363          <template-type-parameter name="KeyType"/>
7364          <template-type-parameter name="KeyTypeKeyCompare"/>
7365          <template-type-parameter name="Disposer"/>
7366        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
7367<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7368<method name="clear_and_dispose"><type>void</type><template>
7369          <template-type-parameter name="Disposer"/>
7370        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
7371<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7372<method name="count" cv="const"><type>size_type</type><template>
7373          <template-type-parameter name="KeyType"/>
7374          <template-type-parameter name="KeyTypeKeyCompare"/>
7375        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7376<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7377<method name="lower_bound"><type>iterator</type><template>
7378          <template-type-parameter name="KeyType"/>
7379          <template-type-parameter name="KeyTypeKeyCompare"/>
7380        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7381<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7382<method name="lower_bound" cv="const"><type>const_iterator</type><template>
7383          <template-type-parameter name="KeyType"/>
7384          <template-type-parameter name="KeyTypeKeyCompare"/>
7385        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7386<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7387<method name="upper_bound"><type>iterator</type><template>
7388          <template-type-parameter name="KeyType"/>
7389          <template-type-parameter name="KeyTypeKeyCompare"/>
7390        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7391<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7392<method name="upper_bound" cv="const"><type>const_iterator</type><template>
7393          <template-type-parameter name="KeyType"/>
7394          <template-type-parameter name="KeyTypeKeyCompare"/>
7395        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7396<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7397<method name="find"><type>iterator</type><template>
7398          <template-type-parameter name="KeyType"/>
7399          <template-type-parameter name="KeyTypeKeyCompare"/>
7400        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7401<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7402<method name="find" cv="const"><type>const_iterator</type><template>
7403          <template-type-parameter name="KeyType"/>
7404          <template-type-parameter name="KeyTypeKeyCompare"/>
7405        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7406<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7407<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
7408          <template-type-parameter name="KeyType"/>
7409          <template-type-parameter name="KeyTypeKeyCompare"/>
7410        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7411<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7412<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
7413          <template-type-parameter name="KeyType"/>
7414          <template-type-parameter name="KeyTypeKeyCompare"/>
7415        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7416<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7417<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
7418          <template-type-parameter name="KeyType"/>
7419          <template-type-parameter name="KeyTypeKeyCompare"/>
7420        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7421<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7422<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
7423          <template-type-parameter name="KeyType"/>
7424          <template-type-parameter name="KeyTypeKeyCompare"/>
7425        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7426<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7427<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7428<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
7429<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
7430<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
7431<method name="merge"><type>void</type><template>
7432          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
7433        </template><parameter name="source"><paramtype><classname>treap_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
7434<method name="merge"><type>void</type><template>
7435          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
7436        </template><parameter name="source"><paramtype><classname>treap_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
7437</method-group>
7438<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
7439<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
7440<constructor><template>
7441          <template-type-parameter name="Iterator"/>
7442        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
7443<constructor><parameter name="x"><paramtype><classname>treap_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></constructor>
7444<copy-assignment><type><classname>treap_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>treap_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></copy-assignment>
7445<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
7446<method-group name="public static functions">
7447<method name="container_from_end_iterator" specifiers="static"><type><classname>treap_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
7448<method name="container_from_end_iterator" specifiers="static"><type>const <classname>treap_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
7449<method name="container_from_iterator" specifiers="static"><type><classname>treap_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
7450<method name="container_from_iterator" specifiers="static"><type>const <classname>treap_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
7451<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
7452<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
7453<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
7454</method-group>
7455</class><class name="treap_set"><template>
7456      <template-type-parameter name="T"/>
7457      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
7458    </template><description><para>The class template <classname alt="boost::intrusive::treap_set">treap_set</classname> is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>compare&lt;&gt;</computeroutput>, <computeroutput>priority&lt;&gt;</computeroutput> and <computeroutput>priority_of_value&lt;&gt;</computeroutput> </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
7459<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
7460<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
7461<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
7462<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
7463<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
7464<typedef name="reference"><type>implementation_defined::reference</type></typedef>
7465<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
7466<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
7467<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
7468<typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
7469<typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
7470<typedef name="priority_type"><type>implementation_defined::priority_type</type></typedef>
7471<typedef name="priority_compare"><type>implementation_defined::priority_compare</type></typedef>
7472<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
7473<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
7474<typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
7475<typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
7476<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
7477<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
7478<typedef name="node"><type>implementation_defined::node</type></typedef>
7479<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
7480<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
7481<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
7482<data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
7483<method-group name="public member functions">
7484<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7485<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7486<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7487<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7488<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7489<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7490<method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7491<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7492<method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7493<method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7494<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7495<method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7496<method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7497<method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7498<method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7499<method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
7500<method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
7501<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7502<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7503<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>treap_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two treaps.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
7504<method name="clone_from"><type>void</type><template>
7505          <template-type-parameter name="Cloner"/>
7506          <template-type-parameter name="Disposer"/>
7507        </template><parameter name="src"><paramtype>const <classname>treap_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
7508<method name="clone_from"><type>void</type><template>
7509          <template-type-parameter name="Cloner"/>
7510          <template-type-parameter name="Disposer"/>
7511        </template><parameter name="src"><paramtype><classname>treap_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
7512<method name="top"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the highest priority object of the treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7513<method name="top" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7514<method name="ctop" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7515<method name="rtop"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7516<method name="rtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7517<method name="crtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7518<method name="priority_comp" cv="const"><type>priority_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7519<method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7520<method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7521<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="prio"><paramtype>const priority_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison or predicate functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
7522<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="prio"><paramtype>const priority_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison or predicate functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
7523<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
7524          <template-type-parameter name="KeyType"/>
7525          <template-type-parameter name="KeyTypeKeyCompare"/>
7526          <template-type-parameter name="PrioType"/>
7527          <template-type-parameter name="PrioValuePrioCompare"/>
7528        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="pcomp"><paramtype>PrioValuePrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
7529<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
7530          <template-type-parameter name="KeyType"/>
7531          <template-type-parameter name="KeyTypeKeyCompare"/>
7532          <template-type-parameter name="PrioType"/>
7533          <template-type-parameter name="PrioValuePrioCompare"/>
7534        </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="pcomp"><paramtype>PrioValuePrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
7535<method name="insert"><type>void</type><template>
7536          <template-type-parameter name="Iterator"/>
7537        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by key_comp().</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7538<method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the <classname alt="boost::intrusive::avl_set">avl_set</classname> using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
7539<method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
7540<method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
7541<method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
7542<method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7543<method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7544<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7545<method name="erase"><type>size_type</type><template>
7546          <template-type-parameter name="KeyType"/>
7547          <template-type-parameter name="KeyTypeKeyCompare"/>
7548        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Equivalent guarantee to <emphasis>while(beg != end) erase(beg++);</emphasis></para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7549<method name="erase_and_dispose"><type>iterator</type><template>
7550          <template-type-parameter name="Disposer"/>
7551        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
7552<method name="erase_and_dispose"><type>iterator</type><template>
7553          <template-type-parameter name="Disposer"/>
7554        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
7555<method name="erase_and_dispose"><type>size_type</type><template>
7556          <template-type-parameter name="Disposer"/>
7557        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7558<method name="erase_and_dispose"><type>size_type</type><template>
7559          <template-type-parameter name="KeyType"/>
7560          <template-type-parameter name="KeyTypeKeyCompare"/>
7561          <template-type-parameter name="Disposer"/>
7562        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
7563<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7564<method name="clear_and_dispose"><type>void</type><template>
7565          <template-type-parameter name="Disposer"/>
7566        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
7567<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7568<method name="count" cv="const"><type>size_type</type><template>
7569          <template-type-parameter name="KeyType"/>
7570          <template-type-parameter name="KeyTypeKeyCompare"/>
7571        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7572<method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7573<method name="lower_bound"><type>iterator</type><template>
7574          <template-type-parameter name="KeyType"/>
7575          <template-type-parameter name="KeyTypeKeyCompare"/>
7576        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7577<method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7578<method name="lower_bound" cv="const"><type>const_iterator</type><template>
7579          <template-type-parameter name="KeyType"/>
7580          <template-type-parameter name="KeyTypeKeyCompare"/>
7581        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7582<method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7583<method name="upper_bound"><type>iterator</type><template>
7584          <template-type-parameter name="KeyType"/>
7585          <template-type-parameter name="KeyTypeKeyCompare"/>
7586        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7587<method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7588<method name="upper_bound" cv="const"><type>const_iterator</type><template>
7589          <template-type-parameter name="KeyType"/>
7590          <template-type-parameter name="KeyTypeKeyCompare"/>
7591        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7592<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7593<method name="find"><type>iterator</type><template>
7594          <template-type-parameter name="KeyType"/>
7595          <template-type-parameter name="KeyTypeKeyCompare"/>
7596        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7597<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7598<method name="find" cv="const"><type>const_iterator</type><template>
7599          <template-type-parameter name="KeyType"/>
7600          <template-type-parameter name="KeyTypeKeyCompare"/>
7601        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7602<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7603<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
7604          <template-type-parameter name="KeyType"/>
7605          <template-type-parameter name="KeyTypeKeyCompare"/>
7606        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7607<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
7608<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
7609          <template-type-parameter name="KeyType"/>
7610          <template-type-parameter name="KeyTypeKeyCompare"/>
7611        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
7612<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7613<method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
7614          <template-type-parameter name="KeyType"/>
7615          <template-type-parameter name="KeyTypeKeyCompare"/>
7616        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7617<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7618<method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
7619          <template-type-parameter name="KeyType"/>
7620          <template-type-parameter name="KeyTypeKeyCompare"/>
7621        </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
7622<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7623<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7624<method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
7625<method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
7626<method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
7627<method name="merge"><type>void</type><template>
7628          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
7629        </template><parameter name="source"><paramtype><classname>treap_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
7630<method name="merge"><type>void</type><template>
7631          <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
7632        </template><parameter name="source"><paramtype><classname>treap_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
7633</method-group>
7634<constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
7635<constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
7636<constructor><template>
7637          <template-type-parameter name="Iterator"/>
7638        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
7639<constructor><parameter name="x"><paramtype><classname>treap_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></constructor>
7640<copy-assignment><type><classname>treap_set</classname> &amp;</type><parameter name="x"><paramtype><classname>treap_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></copy-assignment>
7641<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
7642<method-group name="public static functions">
7643<method name="container_from_end_iterator" specifiers="static"><type><classname>treap_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
7644<method name="container_from_end_iterator" specifiers="static"><type>const <classname>treap_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
7645<method name="container_from_iterator" specifiers="static"><type><classname>treap_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
7646<method name="container_from_iterator" specifiers="static"><type>const <classname>treap_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
7647<method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
7648<method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
7649<method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
7650</method-group>
7651</class>
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703</namespace>
7704</namespace>
7705</header>
7706<header name="boost/intrusive/trivial_value_traits.hpp">
7707<namespace name="boost">
7708<namespace name="intrusive">
7709<struct name="trivial_value_traits"><template>
7710      <template-type-parameter name="NodeTraits"/>
7711      <template-nontype-parameter name="LinkMode"><type>link_mode_type</type><default>safe_link</default></template-nontype-parameter>
7712    </template><description><para>This value traits template is used to create value traits from user defined node traits where value_traits::value_type and node_traits::node should be equal </para></description><typedef name="node_traits"><type>NodeTraits</type></typedef>
7713<typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
7714<typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
7715<typedef name="value_type"><type>node_traits::node</type></typedef>
7716<typedef name="pointer"><type>node_ptr</type></typedef>
7717<typedef name="const_pointer"><type>const_node_ptr</type></typedef>
7718<data-member name="link_mode" specifiers="static"><type>const link_mode_type</type></data-member>
7719<method-group name="public static functions">
7720<method name="to_node_ptr" specifiers="static"><type>node_ptr</type><parameter name="value"><paramtype>value_type &amp;</paramtype></parameter></method>
7721<method name="to_node_ptr" specifiers="static"><type>const_node_ptr</type><parameter name="value"><paramtype>const value_type &amp;</paramtype></parameter></method>
7722<method name="to_value_ptr" specifiers="static"><type>const pointer &amp;</type><parameter name="n"><paramtype>const node_ptr &amp;</paramtype></parameter></method>
7723<method name="to_value_ptr" specifiers="static"><type>const const_pointer &amp;</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter></method>
7724</method-group>
7725</struct>
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777</namespace>
7778</namespace>
7779</header>
7780<header name="boost/intrusive/unordered_set.hpp">
7781<namespace name="boost">
7782<namespace name="intrusive">
7783<struct name="make_unordered_multiset"><template>
7784      <template-type-parameter name="T"/>
7785      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
7786    </template><description><para>Helper metafunction to define an <computeroutput><classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
7787</struct><struct name="make_unordered_set"><template>
7788      <template-type-parameter name="T"/>
7789      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
7790    </template><description><para>Helper metafunction to define an <computeroutput><classname alt="boost::intrusive::unordered_set">unordered_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
7791</struct><class name="unordered_multiset"><template>
7792      <template-type-parameter name="T"/>
7793      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
7794    </template><inherit access="public">boost::intrusive::hashtable&lt; ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags &gt;</inherit><description><para>The class template <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> is an intrusive container, that mimics most of the interface of std::tr1::unordered_multiset as described in the C++ TR1.</para><para><classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> is a semi-intrusive container: each object to be stored in the container must contain a proper hook, but the container also needs additional auxiliary memory to work: <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> needs a pointer to an array of type <computeroutput>bucket_type</computeroutput> to be passed in the constructor. This bucket array must have at least the same lifetime as the container. This makes the use of <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> more complicated than purely intrusive containers. <computeroutput>bucket_type</computeroutput> is default-constructible, copyable and assignable</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>hash&lt;&gt;</computeroutput> and <computeroutput>equal&lt;&gt;</computeroutput> <computeroutput>bucket_traits&lt;&gt;</computeroutput>, <computeroutput>power_2_buckets&lt;&gt;</computeroutput> and <computeroutput>cache_begin&lt;&gt;</computeroutput>.</para><para><classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> only provides forward iterators but it provides 4 iterator types: iterator and const_iterator to navigate through the whole container and local_iterator and const_local_iterator to navigate through the values stored in a single bucket. Local iterators are faster and smaller.</para><para>It's not recommended to use non constant-time size unordered_multisets because several key functions, like "empty()", become non-constant time functions. Non constant-time size unordered_multisets are mainly provided to support auto-unlink hooks.</para><para><classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname>, unlike std::unordered_set, does not make automatic rehashings nor offers functions related to a load factor. Rehashing can be explicitly requested and the user must provide a new bucket array that will be used from that moment.</para><para>Since no automatic rehashing is done, iterators are never invalidated when inserting or erasing elements. Iterators are only invalidated when rehasing. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
7795<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
7796<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
7797<typedef name="bucket_traits"><type>implementation_defined::bucket_traits</type></typedef>
7798<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
7799<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
7800<typedef name="reference"><type>implementation_defined::reference</type></typedef>
7801<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
7802<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
7803<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
7804<typedef name="key_equal"><type>implementation_defined::key_equal</type></typedef>
7805<typedef name="hasher"><type>implementation_defined::hasher</type></typedef>
7806<typedef name="bucket_type"><type>implementation_defined::bucket_type</type></typedef>
7807<typedef name="bucket_ptr"><type>implementation_defined::bucket_ptr</type></typedef>
7808<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
7809<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
7810<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
7811<typedef name="local_iterator"><type>implementation_defined::local_iterator</type></typedef>
7812<typedef name="const_local_iterator"><type>implementation_defined::const_local_iterator</type></typedef>
7813<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
7814<typedef name="node"><type>implementation_defined::node</type></typedef>
7815<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
7816<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
7817<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
7818<method-group name="public member functions">
7819<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7820<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7821<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7822<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7823<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7824<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7825<method name="hash_function" cv="const"><type>hasher</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the hasher object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hasher copy-constructor throws. </para></description></method>
7826<method name="key_eq" cv="const"><type>key_equal</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_equal object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_equal copy-constructor throws. </para></description></method>
7827<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: if constant-time size and <classname alt="boost::intrusive::cache_begin">cache_begin</classname> options are disabled, average constant time (worst case, with empty() == true: O(this-&gt;bucket_count()). Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7828<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is false. Constant-time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7829<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>unordered_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></method>
7830<method name="clone_from"><type>void</type><template>
7831          <template-type-parameter name="Cloner"/>
7832          <template-type-parameter name="Disposer"/>
7833        </template><parameter name="src"><paramtype>const <classname>unordered_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
7834<method name="clone_from"><type>void</type><template>
7835          <template-type-parameter name="Cloner"/>
7836          <template-type-parameter name="Disposer"/>
7837        </template><parameter name="src"><paramtype><classname>unordered_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
7838<method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value into the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the inserted value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7839<method name="insert"><type>void</type><template>
7840          <template-type-parameter name="Iterator"/>
7841        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Equivalent to this-&gt;insert_equal(t) for each element in [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(N), where N is distance(b, e). Worst case O(N*this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7842<method name="erase"><type>void</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. No destructors are called. </para></description></method>
7843<method name="erase"><type>void</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7844<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7845<method name="erase"><type>size_type</type><template>
7846          <template-type-parameter name="KeyType"/>
7847          <template-type-parameter name="KeyHasher"/>
7848          <template-type-parameter name="KeyEqual"/>
7849        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements that have the same hash and compare equal with the given key.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7850<method name="erase_and_dispose"><type>void</type><template>
7851          <template-type-parameter name="Disposer"/>
7852        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
7853<method name="erase_and_dispose"><type>void</type><template>
7854          <template-type-parameter name="Disposer"/>
7855        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
7856<method name="erase_and_dispose"><type>size_type</type><template>
7857          <template-type-parameter name="Disposer"/>
7858        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7859<method name="erase_and_dispose"><type>size_type</type><template>
7860          <template-type-parameter name="KeyType"/>
7861          <template-type-parameter name="KeyHasher"/>
7862          <template-type-parameter name="KeyEqual"/>
7863          <template-type-parameter name="Disposer"/>
7864        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "equal_func". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
7865<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7866<method name="clear_and_dispose"><type>void</type><template>
7867          <template-type-parameter name="Disposer"/>
7868        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7869<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
7870<method name="count" cv="const"><type>size_type</type><template>
7871          <template-type-parameter name="KeyType"/>
7872          <template-type-parameter name="KeyHasher"/>
7873          <template-type-parameter name="KeyEqual"/>
7874        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal throw. </para></description></method>
7875<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element is equal to "value" or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
7876<method name="find"><type>iterator</type><template>
7877          <template-type-parameter name="KeyType"/>
7878          <template-type-parameter name="KeyHasher"/>
7879          <template-type-parameter name="KeyEqual"/>
7880        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hash and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
7881<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
7882<method name="find" cv="const"><type>const_iterator</type><template>
7883          <template-type-parameter name="KeyType"/>
7884          <template-type-parameter name="KeyHasher"/>
7885          <template-type-parameter name="KeyEqual"/>
7886        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hasher and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
7887<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
7888<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
7889          <template-type-parameter name="KeyType"/>
7890          <template-type-parameter name="KeyHasher"/>
7891          <template-type-parameter name="KeyEqual"/>
7892        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or the equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
7893<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
7894<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
7895          <template-type-parameter name="KeyType"/>
7896          <template-type-parameter name="KeyHasher"/>
7897          <template-type-parameter name="KeyEqual"/>
7898        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the hasher or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
7899<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
7900<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
7901<method name="local_iterator_to"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7902<method name="local_iterator_to" cv="const"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7903<method name="bucket_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of buckets passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7904<method name="bucket_size" cv="const"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements in the nth bucket.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7905<method name="bucket" cv="const"><type>size_type</type><parameter name="k"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the hash functor throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
7906<method name="bucket" cv="const"><type>size_type</type><template>
7907          <template-type-parameter name="KeyType"/>
7908          <template-type-parameter name="KeyHasher"/>
7909        </template><parameter name="k"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hash_func throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
7910<method name="bucket_pointer" cv="const"><type>bucket_ptr</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the bucket array pointer passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7911<method name="begin"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
7912<method name="begin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
7913<method name="cbegin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
7914<method name="end"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
7915<method name="end" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
7916<method name="cend" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
7917<method name="rehash"><type>void</type><parameter name="new_bucket_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_bucket_traits can hold a pointer to a new bucket array or the same as the old bucket array with a different length. new_size is the length of the the array pointed by new_buckets. If new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer() new_bucket_traits.bucket_count() can be bigger or smaller than this-&gt;bucket_count(). 'new_bucket_traits' copy constructor should not throw.</para><para><emphasis role="bold">Effects</emphasis>: If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is false, unlinks values from the old bucket and inserts then in the new one according to the hash value of values.</para><para>If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is true, the implementations avoids moving values as much as possible.</para><para>Bucket traits hold by *this is assigned from new_bucket_traits. If the container is configured as incremental&lt;&gt;, the split bucket is set to the new bucket_count().</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function. If false, the implementation tries to minimize calls to the hash function (e.g. once for equivalent values if optimize_multikey&lt;true&gt; is true).</para><para>If rehash is successful updates the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> with new_bucket_traits.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
7918<method name="full_rehash"><type>void</type><description><para><emphasis role="bold">Note</emphasis>: This function is used when keys from inserted elements are changed (e.g. a language change when key is a string) but uniqueness and hash properties are preserved so a fast full rehash recovers invariants for *this without extracting and reinserting all elements again.</para><para><emphasis role="bold">Requires</emphasis>: Calls produced to the hash function should not alter the value uniqueness properties of already inserted elements. If hasher(key1) == hasher(key2) was true when elements were inserted, it shall be true during calls produced in the execution of this function.</para><para>key_equal is not called inside this function so it is assumed that key_equal(value1, value2) should produce the same results as before for inserted elements.</para><para><emphasis role="bold">Effects</emphasis>: Reprocesses all values hold by *this, recalculating their hash values and redistributing them though the buckets.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method uses the hash function and updates the stored hash value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
7919<method name="incremental_rehash"><type>bool</type><parameter name="grow"><paramtype>bool</paramtype><default>true</default></parameter><description><para><emphasis role="bold">Requires</emphasis>:</para><para><emphasis role="bold">Effects</emphasis>:</para><para><emphasis role="bold">Complexity</emphasis>:</para><para><emphasis role="bold">Throws</emphasis>:</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
7920<method name="incremental_rehash"><type>bool</type><parameter name="new_bucket_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If new_bucket_traits.bucket_count() is not this-&gt;bucket_count()/2 or this-&gt;bucket_count()*2, or this-&gt;split_bucket() != new_bucket_traits.bucket_count() returns false and does nothing.</para><para>Otherwise, copy assigns new_bucket_traits to the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> and transfers all the objects from old buckets to the new ones.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to size().</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
7921<method name="split_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Requires</emphasis>: incremental&lt;&gt; option must be set</para><para><emphasis role="bold">Effects</emphasis>: returns the current split count</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing </para></description></method>
7922</method-group>
7923<constructor specifiers="explicit"><parameter name="b_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
7924<constructor><template>
7925          <template-type-parameter name="Iterator"/>
7926        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="b_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource and dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: If N is distance(b, e): Average case is O(N) (with a good hash function and with buckets_len &gt;= N),worst case O(N^2).</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hasher or key_equal throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
7927<constructor><parameter name="x"><paramtype><classname>unordered_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></constructor>
7928<copy-assignment><type><classname>unordered_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>unordered_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></copy-assignment>
7929<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> are not deleted (i.e. no destructors are called).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, if it's a safe-mode or auto-unlink value. Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
7930<method-group name="public static functions">
7931<method name="s_local_iterator_to" specifiers="static"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
7932<method name="s_local_iterator_to" specifiers="static"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
7933<method name="suggested_upper_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is bigger or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the higher possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7934<method name="suggested_lower_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is smaller or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the lowest possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7935</method-group>
7936</class><class name="unordered_set"><template>
7937      <template-type-parameter name="T"/>
7938      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
7939    </template><inherit access="public">boost::intrusive::hashtable&lt; ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags|hash_bool_flags::unique_keys_pos &gt;</inherit><description><para>The class template <classname alt="boost::intrusive::unordered_set">unordered_set</classname> is an intrusive container, that mimics most of the interface of std::tr1::unordered_set as described in the C++ TR1.</para><para><classname alt="boost::intrusive::unordered_set">unordered_set</classname> is a semi-intrusive container: each object to be stored in the container must contain a proper hook, but the container also needs additional auxiliary memory to work: <classname alt="boost::intrusive::unordered_set">unordered_set</classname> needs a pointer to an array of type <computeroutput>bucket_type</computeroutput> to be passed in the constructor. This bucket array must have at least the same lifetime as the container. This makes the use of <classname alt="boost::intrusive::unordered_set">unordered_set</classname> more complicated than purely intrusive containers. <computeroutput>bucket_type</computeroutput> is default-constructible, copyable and assignable</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>hash&lt;&gt;</computeroutput> and <computeroutput>equal&lt;&gt;</computeroutput> <computeroutput>bucket_traits&lt;&gt;</computeroutput>, <computeroutput>power_2_buckets&lt;&gt;</computeroutput> and <computeroutput>cache_begin&lt;&gt;</computeroutput>.</para><para><classname alt="boost::intrusive::unordered_set">unordered_set</classname> only provides forward iterators but it provides 4 iterator types: iterator and const_iterator to navigate through the whole container and local_iterator and const_local_iterator to navigate through the values stored in a single bucket. Local iterators are faster and smaller.</para><para>It's not recommended to use non constant-time size unordered_sets because several key functions, like "empty()", become non-constant time functions. Non constant-time size unordered_sets are mainly provided to support auto-unlink hooks.</para><para><classname alt="boost::intrusive::unordered_set">unordered_set</classname>, unlike std::unordered_set, does not make automatic rehashings nor offers functions related to a load factor. Rehashing can be explicitly requested and the user must provide a new bucket array that will be used from that moment.</para><para>Since no automatic rehashing is done, iterators are never invalidated when inserting or erasing elements. Iterators are only invalidated when rehasing. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
7940<typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
7941<typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
7942<typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
7943<typedef name="bucket_traits"><type>implementation_defined::bucket_traits</type></typedef>
7944<typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
7945<typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
7946<typedef name="reference"><type>implementation_defined::reference</type></typedef>
7947<typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
7948<typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
7949<typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
7950<typedef name="key_equal"><type>implementation_defined::key_equal</type></typedef>
7951<typedef name="hasher"><type>implementation_defined::hasher</type></typedef>
7952<typedef name="bucket_type"><type>implementation_defined::bucket_type</type></typedef>
7953<typedef name="bucket_ptr"><type>implementation_defined::bucket_ptr</type></typedef>
7954<typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
7955<typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
7956<typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
7957<typedef name="local_iterator"><type>implementation_defined::local_iterator</type></typedef>
7958<typedef name="const_local_iterator"><type>implementation_defined::const_local_iterator</type></typedef>
7959<typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
7960<typedef name="node"><type>implementation_defined::node</type></typedef>
7961<typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
7962<typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
7963<typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
7964<method-group name="public member functions">
7965<method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7966<method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7967<method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7968<method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7969<method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7970<method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7971<method name="hash_function" cv="const"><type>hasher</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the hasher object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hasher copy-constructor throws. </para></description></method>
7972<method name="key_eq" cv="const"><type>key_equal</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_equal object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_equal copy-constructor throws. </para></description></method>
7973<method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: if constant-time size and <classname alt="boost::intrusive::cache_begin">cache_begin</classname> options are disabled, average constant time (worst case, with empty() == true: O(this-&gt;bucket_count()). Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7974<method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is false. Constant-time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
7975<method name="swap"><type>void</type><parameter name="other"><paramtype><classname>unordered_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></method>
7976<method name="clone_from"><type>void</type><template>
7977          <template-type-parameter name="Cloner"/>
7978          <template-type-parameter name="Disposer"/>
7979        </template><parameter name="src"><paramtype>const <classname>unordered_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
7980<method name="clone_from"><type>void</type><template>
7981          <template-type-parameter name="Cloner"/>
7982          <template-type-parameter name="Disposer"/>
7983        </template><parameter name="src"><paramtype><classname>unordered_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
7984<method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Tries to inserts value into the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Returns</emphasis>: If the value is not already present inserts it and returns a pair containing the iterator to the new value and true. If there is an equivalent value returns a pair containing an iterator to the already present value and false.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7985<method name="insert"><type>void</type><template>
7986          <template-type-parameter name="Iterator"/>
7987        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Equivalent to this-&gt;insert_unique(t) for each element in [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(N), where N is distance(b, e). Worst case O(N*this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
7988<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hasher or key_compare throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the hash or the equality is much cheaper to construct than the value_type and this function offers the possibility to use that the part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time.</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
7989<method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
7990          <template-type-parameter name="KeyType"/>
7991          <template-type-parameter name="KeyHasher"/>
7992          <template-type-parameter name="KeyEqual"/>
7993        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hasher"><paramtype>KeyHasher</paramtype></parameter><parameter name="key_value_equal"><paramtype>KeyEqual</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the hash or the equality is much cheaper to construct than the value_type and this function offers the possibility to use that the part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time.</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
7994<method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
7995<method name="erase"><type>void</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. No destructors are called. </para></description></method>
7996<method name="erase"><type>void</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7997<method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
7998<method name="erase"><type>size_type</type><template>
7999          <template-type-parameter name="KeyType"/>
8000          <template-type-parameter name="KeyHasher"/>
8001          <template-type-parameter name="KeyEqual"/>
8002        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements that have the same hash and compare equal with the given key.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
8003<method name="erase_and_dispose"><type>void</type><template>
8004          <template-type-parameter name="Disposer"/>
8005        </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
8006<method name="erase_and_dispose"><type>void</type><template>
8007          <template-type-parameter name="Disposer"/>
8008        </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
8009<method name="erase_and_dispose"><type>size_type</type><template>
8010          <template-type-parameter name="Disposer"/>
8011        </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
8012<method name="erase_and_dispose"><type>size_type</type><template>
8013          <template-type-parameter name="KeyType"/>
8014          <template-type-parameter name="KeyHasher"/>
8015          <template-type-parameter name="KeyEqual"/>
8016          <template-type-parameter name="Disposer"/>
8017        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "equal_func". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
8018<method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
8019<method name="clear_and_dispose"><type>void</type><template>
8020          <template-type-parameter name="Disposer"/>
8021        </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
8022<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
8023<method name="count" cv="const"><type>size_type</type><template>
8024          <template-type-parameter name="KeyType"/>
8025          <template-type-parameter name="KeyHasher"/>
8026          <template-type-parameter name="KeyEqual"/>
8027        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal throw. </para></description></method>
8028<method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element is equal to "value" or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
8029<method name="find"><type>iterator</type><template>
8030          <template-type-parameter name="KeyType"/>
8031          <template-type-parameter name="KeyHasher"/>
8032          <template-type-parameter name="KeyEqual"/>
8033        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hash and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
8034<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
8035<method name="find" cv="const"><type>const_iterator</type><template>
8036          <template-type-parameter name="KeyType"/>
8037          <template-type-parameter name="KeyHasher"/>
8038          <template-type-parameter name="KeyEqual"/>
8039        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hasher and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
8040<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
8041<method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
8042          <template-type-parameter name="KeyType"/>
8043          <template-type-parameter name="KeyHasher"/>
8044          <template-type-parameter name="KeyEqual"/>
8045        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or the equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
8046<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
8047<method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
8048          <template-type-parameter name="KeyType"/>
8049          <template-type-parameter name="KeyHasher"/>
8050          <template-type-parameter name="KeyEqual"/>
8051        </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the hasher or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
8052<method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
8053<method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
8054<method name="local_iterator_to"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8055<method name="local_iterator_to" cv="const"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8056<method name="bucket_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of buckets passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8057<method name="bucket_size" cv="const"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements in the nth bucket.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8058<method name="bucket" cv="const"><type>size_type</type><parameter name="k"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the hash functor throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
8059<method name="bucket" cv="const"><type>size_type</type><template>
8060          <template-type-parameter name="KeyType"/>
8061          <template-type-parameter name="KeyHasher"/>
8062        </template><parameter name="k"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hash_func throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
8063<method name="bucket_pointer" cv="const"><type>bucket_ptr</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the bucket array pointer passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8064<method name="begin"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
8065<method name="begin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
8066<method name="cbegin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
8067<method name="end"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
8068<method name="end" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
8069<method name="cend" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
8070<method name="rehash"><type>void</type><parameter name="new_bucket_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_bucket_traits can hold a pointer to a new bucket array or the same as the old bucket array with a different length. new_size is the length of the the array pointed by new_buckets. If new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer() new_bucket_traits.bucket_count() can be bigger or smaller than this-&gt;bucket_count(). 'new_bucket_traits' copy constructor should not throw.</para><para><emphasis role="bold">Effects</emphasis>: If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is false, unlinks values from the old bucket and inserts then in the new one according to the hash value of values.</para><para>If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is true, the implementations avoids moving values as much as possible.</para><para>Bucket traits hold by *this is assigned from new_bucket_traits. If the container is configured as incremental&lt;&gt;, the split bucket is set to the new bucket_count().</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function. If false, the implementation tries to minimize calls to the hash function (e.g. once for equivalent values if optimize_multikey&lt;true&gt; is true).</para><para>If rehash is successful updates the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> with new_bucket_traits.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
8071<method name="full_rehash"><type>void</type><description><para><emphasis role="bold">Note</emphasis>: This function is used when keys from inserted elements are changed (e.g. a language change when key is a string) but uniqueness and hash properties are preserved so a fast full rehash recovers invariants for *this without extracting and reinserting all elements again.</para><para><emphasis role="bold">Requires</emphasis>: Calls produced to the hash function should not alter the value uniqueness properties of already inserted elements. If hasher(key1) == hasher(key2) was true when elements were inserted, it shall be true during calls produced in the execution of this function.</para><para>key_equal is not called inside this function so it is assumed that key_equal(value1, value2) should produce the same results as before for inserted elements.</para><para><emphasis role="bold">Effects</emphasis>: Reprocesses all values hold by *this, recalculating their hash values and redistributing them though the buckets.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method uses the hash function and updates the stored hash value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
8072<method name="incremental_rehash"><type>bool</type><parameter name="grow"><paramtype>bool</paramtype><default>true</default></parameter><description><para><emphasis role="bold">Requires</emphasis>:</para><para><emphasis role="bold">Effects</emphasis>:</para><para><emphasis role="bold">Complexity</emphasis>:</para><para><emphasis role="bold">Throws</emphasis>:</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
8073<method name="incremental_rehash"><type>bool</type><parameter name="new_bucket_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If new_bucket_traits.bucket_count() is not this-&gt;bucket_count()/2 or this-&gt;bucket_count()*2, or this-&gt;split_bucket() != new_bucket_traits.bucket_count() returns false and does nothing.</para><para>Otherwise, copy assigns new_bucket_traits to the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> and transfers all the objects from old buckets to the new ones.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to size().</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
8074<method name="split_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Requires</emphasis>: incremental&lt;&gt; option must be set</para><para><emphasis role="bold">Effects</emphasis>: returns the current split count</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing </para></description></method>
8075</method-group>
8076<constructor specifiers="explicit"><parameter name="b_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
8077<constructor><template>
8078          <template-type-parameter name="Iterator"/>
8079        </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="b_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource and dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: If N is distance(b, e): Average case is O(N) (with a good hash function and with buckets_len &gt;= N),worst case O(N^2).</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hasher or key_equal throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
8080<constructor><parameter name="x"><paramtype><classname>unordered_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal value traits, bucket traits, hasher and comparison are move constructed and nodes belonging to x are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of value traits, bucket traits, hasher or comparison throws. </para></description></constructor>
8081<copy-assignment><type><classname>unordered_set</classname> &amp;</type><parameter name="x"><paramtype><classname>unordered_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap. </para></description></copy-assignment>
8082<destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> are not deleted (i.e. no destructors are called).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, if it's a safe-mode or auto-unlink value. Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
8083<method-group name="public static functions">
8084<method name="s_local_iterator_to" specifiers="static"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
8085<method name="s_local_iterator_to" specifiers="static"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
8086<method name="suggested_upper_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is bigger or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the higher possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8087<method name="suggested_lower_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is smaller or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the lowest possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8088</method-group>
8089</class>
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141</namespace>
8142</namespace>
8143</header>
8144<header name="boost/intrusive/unordered_set_hook.hpp">
8145<namespace name="boost">
8146<namespace name="intrusive">
8147<struct name="make_unordered_set_base_hook"><template>
8148      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
8149    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::unordered_set_base_hook">unordered_set_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
8150</struct><struct name="make_unordered_set_member_hook"><template>
8151      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
8152    </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::unordered_set_member_hook">unordered_set_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
8153</struct><class name="unordered_set_base_hook"><template>
8154      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
8155    </template><inherit access="public">make_unordered_set_base_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::unordered_set_base_hook">unordered_set_base_hook</classname> in order to store objects in in an unordered_set/unordered_multi_set. <classname alt="boost::intrusive::unordered_set_base_hook">unordered_set_base_hook</classname> holds the data necessary to maintain the unordered_set/unordered_multi_set and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for unordered_set/unordered_multi_set.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput>, <computeroutput>store_hash&lt;&gt;</computeroutput> and <computeroutput>optimize_multikey&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>store_hash&lt;&gt;</computeroutput> will tell the hook to store the hash of the value to speed up rehashings.</para><para><computeroutput>optimize_multikey&lt;&gt;</computeroutput> will tell the hook to store a link to form a group with other value with the same value to speed up searches and insertions in unordered_multisets with a great number of with equivalent keys. </para></description><method-group name="public member functions">
8156<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>unordered_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8157<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>unordered_set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
8158<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8159</method-group>
8160<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
8161<constructor><parameter name=""><paramtype>const <classname>unordered_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
8162<copy-assignment><type><classname>unordered_set_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>unordered_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
8163<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an <classname alt="boost::intrusive::unordered_set">unordered_set</classname> an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
8164</class><class name="unordered_set_member_hook"><template>
8165      <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
8166    </template><inherit access="public">make_unordered_set_member_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::unordered_set_member_hook">unordered_set_member_hook</classname> in order to store objects of this class in an unordered_set/unordered_multi_set. <classname alt="boost::intrusive::unordered_set_member_hook">unordered_set_member_hook</classname> holds the data necessary for maintaining the unordered_set/unordered_multi_set and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for unordered_set/unordered_multi_set.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>store_hash&lt;&gt;</computeroutput>.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>store_hash&lt;&gt;</computeroutput> will tell the hook to store the hash of the value to speed up rehashings. </para></description><method-group name="public member functions">
8167<method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>unordered_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8168<method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>unordered_set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
8169<method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
8170</method-group>
8171<constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
8172<constructor><parameter name=""><paramtype>const <classname>unordered_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
8173<copy-assignment><type><classname>unordered_set_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>unordered_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
8174<destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an <classname alt="boost::intrusive::unordered_set">unordered_set</classname> an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
8175</class>
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227</namespace>
8228</namespace>
8229</header>
8230</library-reference>