make_any_base_hook::type< O1, O2, O3 >Derive a class from this hook in order to store objects of that class in an intrusive container.The hook admits the following options: tag<>, void_pointer<> and link_mode<>.tag<> 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 any_base_hook, then each any_base_hook needs its unique tag.link_mode<> will specify the linking mode of the hook (normal_link, safe_link).void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook. boolPrecondition: link_mode must be safe_link.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether container::iterator_to will return a valid iterator.Complexity: Constant Effects: If link_mode is or safe_link initializes the node to an unlinked state.Throws: Nothing. const any_base_hook &Effects: If link_mode is or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. any_base_hook &const any_base_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in a container an assertion is raised.Throws: Nothing. make_any_member_hook::type< O1, O2, O3 >Store this hook in a class to be inserted in an intrusive container.The hook admits the following options: void_pointer<> and link_mode<>.link_mode<> will specify the linking mode of the hook (normal_link or safe_link).void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook. boolPrecondition: link_mode must be safe_link.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether container::iterator_to will return a valid iterator.Complexity: Constant Effects: If link_mode is or safe_link initializes the node to an unlinked state.Throws: Nothing. const any_member_hook &Effects: If link_mode is or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. any_member_hook &const any_member_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in a container an assertion is raised.Throws: Nothing. This option setter specifies that any hook should behave as an avl_set hook This option setter specifies that any hook should behave as a bs_set hook This option setter specifies that any hook should behave as an list hook This option setter specifies that any hook should behave as a set hook This option setter specifies that any hook should behave as an slist hook This option setter specifies that any hook should behave as an unordered set hook Helper metafunction to define a any_base_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a any_member_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined
The class template avl_multiset is an intrusive container, that mimics most of the interface of std::_multiset as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidavl_multiset &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst avl_multiset &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidavl_multiset &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &keyboolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidavl_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidavl_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. avl_multiset &&Effects: 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.Complexity: Constant.Throws: 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. avl_multiset &avl_multiset &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. avl_multiset &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const avl_multiset &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. avl_multiset &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const avl_multiset &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. The class template avl_set is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidavl_set &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst avl_set &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidavl_set &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidavl_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidavl_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. avl_set &&Effects: 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.Complexity: Constant.Throws: 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. avl_set &avl_set &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. avl_set &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const avl_set &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. avl_set &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const avl_set &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. Helper metafunction to define a avl_multiset that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a set that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined boolconst avl_set< T, Options... > &const avl_set< T, Options... > & boolconst avl_set< T, Options... > &const avl_set< T, Options... > & boolconst avl_set< T, Options... > &const avl_set< T, Options... > & boolconst avl_set< T, Options... > &const avl_set< T, Options... > & voidavl_set< T, Options... > &avl_set< T, Options... > & boolconst avl_multiset< T, Options... > &const avl_multiset< T, Options... > & boolconst avl_multiset< T, Options... > &const avl_multiset< T, Options... > & boolconst avl_multiset< T, Options... > &const avl_multiset< T, Options... > & boolconst avl_multiset< T, Options... > &const avl_multiset< T, Options... > & voidavl_multiset< T, Options... > &avl_multiset< T, Options... > &
make_avl_set_base_hook::type< O1, O2, O3, O4 >Derive a class from avl_set_base_hook in order to store objects in in an avl_set/avl_multiset. avl_set_base_hook holds the data necessary to maintain the avl_set/avl_multiset and provides an appropriate value_traits class for avl_set/avl_multiset.The hook admits the following options: tag<>, void_pointer<>, link_mode<> and optimize_size<>.tag<> 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 list_base_hook, then each list_base_hook needs its unique tag.void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).optimize_size<> will tell the hook to optimize the hook for size instead of speed. voidavl_set_base_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether set::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const avl_set_base_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. avl_set_base_hook &const avl_set_base_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in a set an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing. make_avl_set_member_hook::type< O1, O2, O3, O4 >Put a public data member avl_set_member_hook in order to store objects of this class in an avl_set/avl_multiset. avl_set_member_hook holds the data necessary for maintaining the avl_set/avl_multiset and provides an appropriate value_traits class for avl_set/avl_multiset.The hook admits the following options: void_pointer<>, link_mode<> and optimize_size<>.void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).optimize_size<> will tell the hook to optimize the hook for size instead of speed. voidavl_set_member_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether set::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const avl_set_member_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. avl_set_member_hook &const avl_set_member_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in a set an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing. Helper metafunction to define a avl_set_base_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a avl_set_member_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined
The class template avltree is an intrusive AVL tree container, that is used to construct intrusive avl_set and avl_multiset containers. The no-throw guarantee holds only, if the key_compare object doesn't throw.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. ValueTraits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms implementation_defined::insert_commit_data const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidavltree &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst avltree &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidavltree &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidavltree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidavltree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. boolIteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. avltree &&Effects: 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.Complexity: Constant.Throws: 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. avltree &avltree &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. avltree &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const avltree &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. avltree &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const avltree &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. Helper metafunction to define a avltree that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined
avltree_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:Typedefs:node: The type of the node that forms the binary search treenode_ptr: A pointer to a nodeconst_node_ptr: A pointer to a const nodebalance: The type of the balance factorStatic functions:static node_ptr get_parent(const_node_ptr n);static void set_parent(node_ptr n, node_ptr parent);static node_ptr get_left(const_node_ptr n);static void set_left(node_ptr n, node_ptr left);static node_ptr get_right(const_node_ptr n);static void set_right(node_ptr n, node_ptr right);static balance get_balance(const_node_ptr n);static void set_balance(node_ptr n, balance b);static balance negative();static balance zero();static balance positive(); NodeTraits::node NodeTraits NodeTraits::node_ptr NodeTraits::const_node_ptr NodeTraits::balance This type is the information that will be filled by insert_unique_check bstree_algo::insert_commit_data node_ptrconst const_node_ptr &Requires: 'node' is a node of the tree or a header node.Effects: Returns the header of the tree.Complexity: Logarithmic.Throws: Nothing. node_ptrconst const_node_ptr &Requires: 'header' is the header node of a tree.Effects: Returns the first node of the tree, the header if the tree is empty.Complexity: Constant time.Throws: Nothing. node_ptrconst const_node_ptr &Requires: 'header' is the header node of a tree.Effects: Returns the header of the tree.Complexity: Constant time.Throws: Nothing. voidnode_ptrnode_ptrRequires: header1 and header2 must be the header nodes of two trees.Effects: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.Complexity: Constant.Throws: Nothing. voidnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees.Effects: 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.Complexity: Logarithmic.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees with header header1 and header2.Effects: 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.Complexity: Constant.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Logarithmic.Throws: Nothing.Note: 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 voidnode_ptrnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Constant.Throws: Nothing.Note: 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 voidnode_ptrRequires: node is a tree node but not the header.Effects: Unlinks the node and rebalances the tree.Complexity: Average complexity is constant time.Throws: Nothing. node_ptrconst node_ptr &Requires: header is the header of a tree.Effects: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. boolconst const_node_ptr &Requires: 'node' is a node of the tree or a node initialized by init(...) or init_node.Effects: Returns true if the node is initialized by init() or init_node().Complexity: Constant time.Throws: Nothing. std::size_tconst const_node_ptr &Requires: node is a node of the tree but it's not the header.Effects: Returns the number of nodes of the subtree.Complexity: Linear time.Throws: Nothing. node_ptrconst node_ptr &Requires: 'node' is a node from the tree except the header.Effects: Returns the next node of the tree.Complexity: Average constant time.Throws: Nothing. node_ptrconst node_ptr &Requires: 'node' is a node from the tree except the leftmost node.Effects: Returns the previous node of the tree.Complexity: Average constant time.Throws: Nothing. voidconst node_ptr &Requires: 'node' must not be part of any tree.Effects: After the function unique(node) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. voidnode_ptrRequires: node must not be part of any tree.Effects: Initializes the header to represent an empty tree. unique(header) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. node_ptrnode_ptrnode_ptrRequires: header must be the header of a tree, z a node of that tree and z != header.Effects: Erases node "z" from the tree with header "header".Complexity: Amortized constant time.Throws: Nothing. boolnode_ptrNodePtrComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.Returns: True if the node was trasferred, false otherwise.Complexity: Logarithmic.Throws: If the comparison throws. voidnode_ptrNodePtrComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2.Complexity: Logarithmic.Throws: If the comparison throws. voidconst const_node_ptr &node_ptrClonerDisposerRequires: "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.Effects: First empties target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Then, duplicates the entire tree pointed by "source_header" cloning each source node with node_ptr Cloner::operator()(const node_ptr &) to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using void disposer(const node_ptr &).Complexity: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. voidconst node_ptr &DisposerRequires: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.Effects: Empties the target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Complexity: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. node_ptrconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const const_node_ptr &const KeyType &const KeyType &KeyNodePtrCompareboolboolRequires: "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.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If "comp" throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change. std::size_tconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns the number of elements with a key equivalent to "key" according to "comp".Complexity: Logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: Inserts new_node into the tree before the upper bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: Inserts new_node into the tree before the lower bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: 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).Complexity: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".Throws: If "comp" throws. node_ptrnode_ptrnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. voidnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". voidnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". std::pair< node_ptr, bool >const const_node_ptr &const KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. std::pair< node_ptr, bool >const const_node_ptr &const node_ptr &const KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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).Returns: 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.Complexity: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. voidnode_ptrnode_ptrconst insert_commit_data &Requires: "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".Effects: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.Complexity: Constant time.Throws: Nothing.Notes: 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. boolconst const_node_ptr &Requires: p is a node of a tree.Effects: Returns true if p is the header of the tree.Complexity: Constant.Throws: Nothing.
The class template bs_multiset is an intrusive container, that mimics most of the interface of std::multiset as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidbs_multiset &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst bs_multiset &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidbs_multiset &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidbs_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidbs_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. bs_multiset &&Effects: 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.Complexity: Constant.Throws: 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. bs_multiset &bs_multiset &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. bs_multiset &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const bs_multiset &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. bs_multiset &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const bs_multiset &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. The class template bs_set is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidbs_set &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst bs_set &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidbs_set &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidbs_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidbs_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. bs_set &&Effects: 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.Complexity: Constant.Throws: 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. bs_set &bs_set &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. bs_set &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const bs_set &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. bs_set &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const bs_set &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. Helper metafunction to define a bs_multiset that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a bs_set that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined boolconst bs_set< T, Options... > &const bs_set< T, Options... > & boolconst bs_set< T, Options... > &const bs_set< T, Options... > & boolconst bs_set< T, Options... > &const bs_set< T, Options... > & boolconst bs_set< T, Options... > &const bs_set< T, Options... > & voidbs_set< T, Options... > &bs_set< T, Options... > & boolconst bs_multiset< T, Options... > &const bs_multiset< T, Options... > & boolconst bs_multiset< T, Options... > &const bs_multiset< T, Options... > & boolconst bs_multiset< T, Options... > &const bs_multiset< T, Options... > & boolconst bs_multiset< T, Options... > &const bs_multiset< T, Options... > & voidbs_multiset< T, Options... > &bs_multiset< T, Options... > &
make_bs_set_base_hook::type< O1, O2, O3 >Derive a class from bs_set_base_hook in order to store objects in in a bs_set/bs_multiset. bs_set_base_hook holds the data necessary to maintain the bs_set/bs_multiset and provides an appropriate value_traits class for bs_set/bs_multiset.The hook admits the following options: tag<>, void_pointer<>, link_mode<>.tag<> 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 list_base_hook, then each list_base_hook needs its unique tag.void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link). voidbs_set_base_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether set::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const bs_set_base_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. bs_set_base_hook &const bs_set_base_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in a set an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing. make_bs_set_member_hook::type< O1, O2, O3 >Put a public data member bs_set_member_hook in order to store objects of this class in a bs_set/bs_multiset. bs_set_member_hook holds the data necessary for maintaining the bs_set/bs_multiset and provides an appropriate value_traits class for bs_set/bs_multiset.The hook admits the following options: void_pointer<>, link_mode<>.void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link). voidbs_set_member_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether set::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const bs_set_member_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. bs_set_member_hook &const bs_set_member_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in a set an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing. Helper metafunction to define a bs_set_base_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a bs_set_member_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined
bstbase< ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, ConstantTimeSize, SizeType, AlgoType, HeaderHolder >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.The complexity guarantees only hold if the tree is balanced, logarithmic complexity would increase to linear if the tree is totally unbalanced.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined implementation_defined node_algorithms::insert_commit_data const bool const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidbstree &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst bstree &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidbstree &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidEffects: Rebalances the tree.Throws: Nothing.Complexity: Linear. iteratoriteratorRequires: old_root is a node of a tree.Effects: Rebalances the subtree rooted at old_root.Returns: The new root of the subtree.Throws: Nothing.Complexity: Linear to the elements in the subtree. voidbstree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) it !itend voidbstree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) it !itend voidExtraCheckerEffects: Asserts the integrity of the container with additional checks provided by the user.Complexity: Linear time.Note: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. voidEffects: Asserts the integrity of the container.Complexity: Linear time.Note: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. boolIteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. bstree &&Effects: 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.Complexity: Constant.Throws: 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. bstree &bstree &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. bstree &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const bstree &const_iteratorPrecondition: end_iterator must be a valid end const_iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Constant. bstree &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const bstree &const_iteratorPrecondition: it must be a valid end const_iterator of container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. Helper metafunction to define a bstree that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined
bstree_algorithms_base< NodeTraits >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. +---------+ header------------------------------>| | | | +----------(left)--------| |--------(right)---------+ | +---------+ | | | | | | (parent) | | | | | | | | +---------+ | root of tree ..|......................> | | | | | D | | | | | | | +----+------+----+ | | +------+ +------+ | | | | | | | | | B | | F | | | | | | | | | +–+------+–+ +–+------+–+ | | ++--+ +--++ ++--+ +--++ | +-->| | | | | | | |<–+ | A | | C | | E | | G | | | | | | | | | +------+ +------+ +------+ +------+bstree_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:Typedefs:node: The type of the node that forms the binary search treenode_ptr: A pointer to a nodeconst_node_ptr: A pointer to a const nodeStatic functions:static node_ptr get_parent(const_node_ptr n);static void set_parent(node_ptr n, node_ptr parent);static node_ptr get_left(const_node_ptr n);static void set_left(node_ptr n, node_ptr left);static node_ptr get_right(const_node_ptr n);static void set_right(node_ptr n, node_ptr right); NodeTraits::node NodeTraits NodeTraits::node_ptr NodeTraits::const_node_ptr insert_commit_data_t< node_ptr > data_for_rebalance_t< node_ptr > node_ptrconst const_node_ptr &Requires: 'header' is the header node of a tree.Effects: Returns the first node of the tree, the header if the tree is empty.Complexity: Constant time.Throws: Nothing. node_ptrconst const_node_ptr &Requires: 'header' is the header node of a tree.Effects: Returns the header of the tree.Complexity: Constant time.Throws: Nothing. node_ptrconst const_node_ptr &Requires: 'header' is the header node of a tree.Effects: Returns the root of the tree if any, header otherwiseComplexity: Constant time.Throws: Nothing. boolconst const_node_ptr &Requires: 'node' is a node of the tree or a node initialized by init(...) or init_node.Effects: Returns true if the node is initialized by init() or init_node().Complexity: Constant time.Throws: Nothing. node_ptrconst const_node_ptr &Requires: 'node' is a node of the tree or a header node.Effects: Returns the header of the tree.Complexity: Logarithmic.Throws: Nothing. voidnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees.Effects: 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.Complexity: Logarithmic.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees with header header1 and header2.Effects: 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.Complexity: Constant.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Logarithmic.Throws: Nothing.Note: 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 voidnode_ptrnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Constant.Throws: Nothing.Note: 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 node_ptrconst node_ptr &Requires: 'node' is a node from the tree except the header.Effects: Returns the next node of the tree.Complexity: Average constant time.Throws: Nothing. node_ptrconst node_ptr &Requires: 'node' is a node from the tree except the leftmost node.Effects: Returns the previous node of the tree.Complexity: Average constant time.Throws: Nothing. node_ptrnode_ptrRequires: 'node' is a node of a tree but not the header.Effects: Returns the minimum node of the subtree starting at p.Complexity: Logarithmic to the size of the subtree.Throws: Nothing. node_ptrnode_ptrRequires: 'node' is a node of a tree but not the header.Effects: Returns the maximum node of the subtree starting at p.Complexity: Logarithmic to the size of the subtree.Throws: Nothing. voidnode_ptrRequires: 'node' must not be part of any tree.Effects: After the function unique(node) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. boolconst const_node_ptr &Effects: Returns true if node is in the same state as if called init(node)Complexity: Constant.Throws: Nothing. voidnode_ptrRequires: node must not be part of any tree.Effects: Initializes the header to represent an empty tree. unique(header) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. voidconst node_ptr &DisposerRequires: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.Effects: Empties the target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Complexity: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. node_ptrnode_ptrRequires: header is the header of a tree.Effects: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. std::size_tconst const_node_ptr &Requires: node is a node of the tree but it's not the header.Effects: Returns the number of nodes of the subtree.Complexity: Linear time.Throws: Nothing. voidnode_ptrnode_ptrRequires: header1 and header2 must be the header nodes of two trees.Effects: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.Complexity: Constant.Throws: Nothing. boolconst const_node_ptr &Requires: p is a node of a tree.Effects: Returns true if p is the header of the tree.Complexity: Constant.Throws: Nothing. node_ptrconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const const_node_ptr &const KeyType &const KeyType &KeyNodePtrCompareboolboolRequires: "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.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If "comp" throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change. std::size_tconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns the number of elements with a key equivalent to "key" according to "comp".Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. voidnode_ptrnode_ptrconst insert_commit_data &Requires: "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".Effects: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.Complexity: Constant time.Throws: Nothing.Notes: 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. std::pair< node_ptr, bool >const const_node_ptr &const KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. std::pair< node_ptr, bool >const const_node_ptr &const node_ptr &const KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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).Returns: 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.Complexity: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. node_ptrnode_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: 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).Complexity: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".Throws: If "comp" throws. node_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: Inserts new_node into the tree before the upper bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: Inserts new_node into the tree before the lower bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. voidnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". voidnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". std::size_tconst_node_ptrRequires: 'node' can't be a header node.Effects: 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.)Complexity: Logarithmic to the number of nodes in the tree.Throws: Nothing. voidconst const_node_ptr &node_ptrClonerDisposerRequires: "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.Effects: First empties target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Then, duplicates the entire tree pointed by "source_header" cloning each source node with node_ptr Cloner::operator()(const node_ptr &) to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using void disposer(const node_ptr &).Complexity: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. voidnode_ptrnode_ptrRequires: header must be the header of a tree, z a node of that tree and z != header.Effects: Erases node "z" from the tree with header "header".Complexity: Amortized constant time.Throws: Nothing. boolnode_ptrNodePtrComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.Returns: True if the node was trasferred, false otherwise.Complexity: Logarithmic.Throws: If the comparison throws. voidnode_ptrNodePtrComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2.Complexity: Logarithmic.Throws: If the comparison throws. voidnode_ptrRequires: node is a tree node but not the header.Effects: Unlinks the node and rebalances the tree.Complexity: Average complexity is constant time.Throws: Nothing. voidnode_ptrRequires: header must be the header of a tree.Effects: Rebalances the tree.Throws: Nothing.Complexity: Linear. node_ptrnode_ptrRequires: old_root is a node of a tree. It shall not be null.Effects: Rebalances the subtree rooted at old_root.Returns: The new root of the subtree.Throws: Nothing.Complexity: Linear. voidconst const_node_ptr &Checkertypename Checker::return_type &Effects: Asserts the integrity of the container with additional checks provided by the user.Requires: header must be the header of a tree.Complexity: Linear time.Note: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. boolnode_ptrNodePtrComparenode_ptrnode_ptrdata_for_rebalance & voidnode_ptrNodePtrComparenode_ptrnode_ptrdata_for_rebalance & voidnode_ptrnode_ptrdata_for_rebalance & std::size_tconst const_node_ptr &Requires: node is a node of the tree but it's not the header.Effects: Returns the number of nodes of the subtree.Complexity: Linear time.Throws: Nothing. boolconst node_ptr &Requires: p is a node of a tree.Effects: Returns true if p is a left child.Complexity: Constant.Throws: Nothing. boolconst node_ptr &Requires: p is a node of a tree.Effects: Returns true if p is a right child.Complexity: Constant.Throws: Nothing. voidnode_ptrnode_ptrinsert_commit_data & voidnode_ptrinsert_commit_data & voidnode_ptrinsert_commit_data & voidnode_ptrnode_ptrnode_ptrNodePtrCompareinsert_commit_data & voidnode_ptrnode_ptrNodePtrCompareinsert_commit_data &std::size_t *0 voidnode_ptrnode_ptrNodePtrCompareinsert_commit_data &std::size_t *0 voidnode_ptrnode_ptrconst insert_commit_data & voidnode_ptrnode_ptrnode_ptrconst bool voidnode_ptrnode_ptr voidnode_ptrnode_ptrnode_ptrnode_ptr voidnode_ptrnode_ptr voidnode_ptrnode_ptrnode_ptrnode_ptr voidnode_ptrstd::size_t & voidnode_ptrstd::size_t voidnode_ptrstd::size_t node_ptrconst node_ptr &Requires: "n" must be a node inserted in a tree.Effects: Returns a pointer to the header node of the tree.Complexity: Logarithmic.Throws: Nothing. node_ptrconst const_node_ptr &node_ptrClonerDisposernode_ptr &node_ptr & voidnode_ptrDisposer node_ptrnode_ptrnode_ptrconst KeyType &KeyNodePtrCompare node_ptrnode_ptrnode_ptrconst KeyType &KeyNodePtrCompare voidconst const_node_ptr &Checkertypename Checker::return_type &
circular_list_algorithms 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.circular_list_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:Typedefs:node: The type of the node that forms the circular listnode_ptr: A pointer to a nodeconst_node_ptr: A pointer to a const nodeStatic functions:static node_ptr get_previous(const_node_ptr n);static void set_previous(node_ptr n, node_ptr prev);static node_ptr get_next(const_node_ptr n);static void set_next(node_ptr n, node_ptr next); std::size_t std::size_t node_ptr NodeTraits::node NodeTraits::node_ptr NodeTraits::const_node_ptr NodeTraits voidnode_ptrEffects: Constructs an non-used list element, so that inited(this_node) == trueComplexity: ConstantThrows: Nothing. boolconst const_node_ptr &Effects: Returns true is "this_node" is in a non-used state as if it was initialized by the "init" function.Complexity: ConstantThrows: Nothing. voidnode_ptrEffects: Constructs an empty list, making this_node the only node of the circular list: NodeTraits::get_next(this_node) == NodeTraits::get_previous(this_node) == this_node.Complexity: ConstantThrows: Nothing. boolconst const_node_ptr &Requires: this_node must be in a circular list or be an empty circular list.Effects: Returns true is "this_node" is the only node of a circular list: return NodeTraits::get_next(this_node) == this_nodeComplexity: ConstantThrows: Nothing. std::size_tconst const_node_ptr &Requires: this_node must be in a circular list or be an empty circular list.Effects: Returns the number of nodes in a circular list. If the circular list is empty, returns 1.Complexity: LinearThrows: Nothing. node_ptrnode_ptrRequires: this_node must be in a circular list or be an empty circular list.Effects: Unlinks the node from the circular list.Complexity: ConstantThrows: Nothing. voidnode_ptrnode_ptrRequires: b and e must be nodes of the same circular list or an empty range.Effects: Unlinks the node [b, e) from the circular list.Complexity: ConstantThrows: Nothing. voidnode_ptrnode_ptrRequires: nxt_node must be a node of a circular list.Effects: Links this_node before nxt_node in the circular list.Complexity: ConstantThrows: Nothing. voidnode_ptrnode_ptrRequires: prev_node must be a node of a circular list.Effects: Links this_node after prev_node in the circular list.Complexity: ConstantThrows: Nothing. voidnode_ptrnode_ptrRequires: this_node and other_node must be nodes inserted in circular lists or be empty circular lists.Effects: 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.Complexity: ConstantThrows: Nothing. voidnode_ptrnode_ptrnode_ptrRequires: 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 Effects: Removes the nodes from [b, e) range from their circular list and inserts them before p in p's circular list.Complexity: ConstantThrows: Nothing. voidnode_ptrnode_ptrRequires: i must a node of a circular list and p must be a node of a different circular list.Effects: 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.Complexity: ConstantThrows: Nothing. voidnode_ptrEffects: Reverses the order of elements in the list.Throws: Nothing.Complexity: This function is linear time. voidnode_ptrstd::size_tEffects: Moves the node p n positions towards the end of the list.Throws: Nothing.Complexity: Linear to the number of moved positions. voidnode_ptrstd::size_tEffects: Moves the node p n positions towards the beginning of the list.Throws: Nothing.Complexity: Linear to the number of moved positions. std::size_tconst const_node_ptr &const const_node_ptr &Requires: f and l must be in a circular list.Effects: Returns the number of nodes in the range [f, l).Complexity: LinearThrows: Nothing. voidnode_ptrnode_ptrPredstable_partition_info & voidnode_ptrnode_ptr voidnode_ptrnode_ptr
circular_slist_algorithms 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.circular_slist_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:Typedefs:node: The type of the node that forms the circular listnode_ptr: A pointer to a nodeconst_node_ptr: A pointer to a const nodeStatic functions:static node_ptr get_next(const_node_ptr n);static void set_next(node_ptr n, node_ptr next); NodeTraits::node NodeTraits::node_ptr NodeTraits::const_node_ptr NodeTraits voidnode_ptrEffects: Constructs an non-used list element, putting the next pointer to null: NodeTraits::get_next(this_node) == node_ptr()Complexity: ConstantThrows: Nothing. boolconst_node_ptrRequires: this_node must be in a circular list or be an empty circular list.Effects: Returns true is "this_node" is the only node of a circular list: or it's a not inserted node: return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_nodeComplexity: ConstantThrows: Nothing. boolconst_node_ptrEffects: Returns true is "this_node" has the same state as if it was inited using "init(node_ptr)"Complexity: ConstantThrows: Nothing. voidnode_ptrRequires: prev_node must be in a circular list or be an empty circular list.Effects: Unlinks the next node of prev_node from the circular list.Complexity: ConstantThrows: Nothing. voidnode_ptrnode_ptrRequires: prev_node and last_node must be in a circular list or be an empty circular list.Effects: Unlinks the range (prev_node, last_node) from the circular list.Complexity: ConstantThrows: Nothing. voidnode_ptrnode_ptrRequires: prev_node must be a node of a circular list.Effects: Links this_node after prev_node in the circular list.Complexity: ConstantThrows: Nothing. voidnode_ptrnode_ptrnode_ptrRequires: 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.Effects: Removes the nodes from (b, e] range from their circular list and inserts them after p in p's circular list.Complexity: ConstantThrows: Nothing. voidnode_ptrEffects: Constructs an empty list, making this_node the only node of the circular list: NodeTraits::get_next(this_node) == this_node.Complexity: ConstantThrows: Nothing. node_ptrconst node_ptr &const node_ptr &Requires: this_node and prev_init_node must be in the same circular list.Effects: 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).Complexity: Linear to the number of elements between prev_init_node and this_node.Throws: Nothing. node_ptrconst node_ptr &Requires: this_node must be in a circular list or be an empty circular list.Effects: Returns the previous node of this_node in the circular list.Complexity: Linear to the number of elements in the circular list.Throws: Nothing. node_ptrconst node_ptr &Requires: this_node must be in a circular list or be an empty circular list.Effects: Returns the previous node of the previous node of this_node in the circular list.Complexity: Linear to the number of elements in the circular list.Throws: Nothing. node_ptrnode_ptrconst node_ptr &Requires: this_node and p must be in the same circular list.Effects: 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)).Complexity: Linear to the number of elements in the circular list.Throws: Nothing. std::size_tconst const_node_ptr &Requires: this_node must be in a circular list or be an empty circular list.Effects: Returns the number of nodes in a circular list. If the circular list is empty, returns 1.Complexity: LinearThrows: Nothing. voidnode_ptrRequires: this_node must be in a circular list, be an empty circular list or be inited.Effects: Unlinks the node from the circular list.Complexity: Linear to the number of elements in the circular listThrows: Nothing. voidnode_ptrnode_ptrRequires: nxt_node must be a node of a circular list.Effects: Links this_node before nxt_node in the circular list.Complexity: Linear to the number of elements in the circular list.Throws: Nothing. voidnode_ptrnode_ptrRequires: this_node and other_node must be nodes inserted in circular lists or be empty circular lists.Effects: 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.Complexity: Linear to number of elements of both listsThrows: Nothing. voidnode_ptrEffects: Reverses the order of elements in the list.Throws: Nothing.Complexity: This function is linear to the contained elements. node_ptrnode_ptrstd::size_tEffects: Moves the node p n positions towards the end of the list.Returns: The previous node of p after the function if there has been any movement, Null if n leads to no movement.Throws: Nothing.Complexity: Linear to the number of elements plus the number moved positions. node_ptrnode_ptrstd::size_tEffects: Moves the node p n positions towards the beginning of the list.Returns: The previous node of p after the function if there has been any movement, Null if n leads equals to no movement.Throws: Nothing.Complexity: Linear to the number of elements plus the number moved positions.
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 NodeTraits T node_traits::node node_traits::node_ptr node_traits::const_node_ptr pointer_traits< node_ptr >::template rebind_pointer< value_type >::type pointer_traits< node_ptr >::template rebind_pointer< const value_type >::type boost::intrusive::pointer_traits< pointer >::reference boost::intrusive::pointer_traits< const_pointer >::reference const link_mode_type node_ptrreference const_node_ptrconst_reference pointerconst node_ptr & const_pointerconst const_node_ptr &
hashtable_size_traits_wrapper< hashdata_internal< ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags &(hash_bool_flags::incremental_pos|hash_bool_flags::cache_begin_pos) >, SizeType,(BoolFlags &hash_bool_flags::constant_time_size_pos) !=0 >The class template hashtable is an intrusive hash table container, that is used to construct intrusive unordered_set and unordered_multiset containers. The no-throw guarantee holds only, if the VoidOrKeyEqual object and Hasher don't throw.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 bucket_type 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. bucket_type is default-constructible, copyable and assignableThe template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<>, hash<> and equal<> bucket_traits<>, power_2_buckets<>, cache_begin<> and incremental<>.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.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.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.Since no automatic rehashing is done, iterators are never invalidated when inserting or erasing elements. Iterators are only invalidated when rehashing. ValueTraits value_traits::pointer value_traits::const_pointer value_traits::value_type hash_types_base::key_type hash_types_base::key_of_value pointer_traits< pointer >::reference pointer_traits< const_pointer >::reference pointer_traits< pointer >::difference_type SizeType internal_type::key_equal internal_type::hasher bucket_impl< slist > internal_type::bucket_ptr slist::iterator slist::const_iterator internal_type::iterator internal_type::const_iterator internal_type::local_iterator internal_type::const_local_iterator value_traits::node_traits node_traits::node pointer_traits< pointer >::template rebind_pointer< node >::type pointer_traits< pointer >::template rebind_pointer< const node >::type pointer_traits< node_ptr >::reference pointer_traits< const_node_ptr >::reference slist::node_algorithms unspecified const bool const bool const bool const bool const bool const bool const bool const bool const bool iteratorEffects: Returns an iterator pointing to the beginning of the unordered_set.Complexity: Amortized constant time. Worst case (empty unordered_set): O(this->bucket_count())Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the unordered_set.Complexity: Amortized constant time. Worst case (empty unordered_set): O(this->bucket_count())Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the unordered_set.Complexity: Amortized constant time. Worst case (empty unordered_set): O(this->bucket_count())Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the unordered_set.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the unordered_set.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the unordered_set.Complexity: Constant.Throws: Nothing. hasherEffects: Returns the hasher object used by the unordered_set.Complexity: Constant.Throws: If hasher copy-constructor throws. key_equalEffects: Returns the key_equal object used by the unordered_set.Complexity: Constant.Throws: If key_equal copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: if constant-time size and cache_begin options are disabled, average constant time (worst case, with empty() == true: O(this->bucket_count()). Otherwise constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the unordered_set.Complexity: Linear to elements contained in *this if constant_time_size is false. Constant-time otherwise.Throws: Nothing. voidhashtable &Requires: the hasher and the equality function unqualified swap call should not throw.Effects: Swaps the contents of two unordered_sets. Swaps also the contained bucket array and equality and hasher functors.Complexity: Constant.Throws: If the swap() call for the comparison or hash functors found using ADL throw. Basic guarantee. voidconst hashtable &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.Effects: 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.If store_hash option is true, this method does not use the hash function.If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. voidhashtable &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.Effects: 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.If store_hash option is true, this method does not use the hash function.If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. iteratorreferenceRequires: value must be an lvalueEffects: Inserts the value into the unordered_set.Returns: An iterator to the inserted value.Complexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Equivalent to this->insert_equal(t) for each element in [b, e).Complexity: Average case O(N), where N is distance(b, e). Worst case O(N*this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Tries to inserts value into the unordered_set.Returns: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Equivalent to this->insert_unique(t) for each element in [b, e).Complexity: Average case O(N), where N is distance(b, e). Worst case O(N*this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const KeyType &KeyHasherKeyEqualinsert_commit_data &Requires: "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."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.Effects: Checks if a value can be inserted in the unordered_set, using a user provided key instead of the value itself.Returns: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal_func throw. Strong guarantee.Notes: 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.If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the unordered_set.After a successful rehashing insert_commit_data remains valid. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the unordered_set, using a user provided key instead of the value itself.Returns: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hasher or key_compare throw. Strong guarantee.Notes: 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.If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the unordered_set.After a successful rehashing insert_commit_data remains valid. iteratorreferenceconst insert_commit_data &Requires: 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 unordered_set between the "insert_check" that filled "commit_data" and the call to "insert_commit".Effects: Inserts the value in the unordered_set using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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.After a successful rehashing insert_commit_data remains valid. voidconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average case O(1), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased element. No destructors are called. voidconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average case O(distance(b, e)), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Erases all the elements that have the same hash and compare equal with the given key.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If hash_func or equal_func throw. Basic guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average case O(1), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average case O(distance(b, e)), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyHasherKeyEqualDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "equal_func". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If hash_func or equal_func throw. Basic guarantee.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all of the elements.Complexity: Linear to the number of elements on the container. Disposer::operator()(pointer) is called for the removed elements.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. size_typeconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Returns the number of contained elements with the given keyComplexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal throw. iteratorconst key_type &Effects: Finds an iterator to the first element is equal to "value" or end() if that element does not exist.Complexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. iteratorconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal_func throw.Note: 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. const_iteratorconst key_type &Effects: Finds a const_iterator to the first element whose key is "key" or end() if that element does not exist.Complexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. const_iteratorconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal_func throw.Note: 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. std::pair< iterator, iterator >const key_type &Effects: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. std::pair< iterator, iterator >const KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(key, hash_func, equal_func)). Worst case O(this->size()).Throws: If hash_func or the equal_func throw.Note: 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. std::pair< const_iterator, const_iterator >const key_type &Effects: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. std::pair< const_iterator, const_iterator >const KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(key, hash_func, equal_func)). Worst case O(this->size()).Throws: If the hasher or equal_func throw.Note: 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. iteratorreferenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: If the internal hash function throws. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: If the internal hash function throws. local_iteratorreferenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing. const_local_iteratorconst_referenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of buckets passed in the constructor or the last rehash function.Complexity: Constant.Throws: Nothing. size_typesize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns the number of elements in the nth bucket.Complexity: Constant.Throws: Nothing. size_typeconst key_type &Effects: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.Complexity: Constant.Throws: If the hash functor throws.Note: the return value is in the range [0, this->bucket_count()). size_typeconst KeyType &KeyHasherRequires: "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.Effects: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.Complexity: Constant.Throws: If hash_func throws.Note: the return value is in the range [0, this->bucket_count()). bucket_ptrEffects: Returns the bucket array pointer passed in the constructor or the last rehash function.Complexity: Constant.Throws: Nothing. local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a local_iterator pointing to the beginning of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a local_iterator pointing to the end of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. voidconst bucket_traits &Requires: 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->bucket_pointer() new_bucket_traits.bucket_count() can be bigger or smaller than this->bucket_count(). 'new_bucket_traits' copy constructor should not throw.Effects: If new_bucket_traits.bucket_begin() == this->bucket_pointer() is false, unlinks values from the old bucket and inserts then in the new one according to the hash value of values.If new_bucket_traits.bucket_begin() == this->bucket_pointer() is true, the implementations avoids moving values as much as possible.Bucket traits hold by *this is assigned from new_bucket_traits. If the container is configured as incremental<>, the split bucket is set to the new bucket_count().If store_hash 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<true> is true).If rehash is successful updates the internal bucket_traits with new_bucket_traits.Complexity: Average case linear in this->size(), worst case quadratic.Throws: If the hasher functor throws. Basic guarantee. voidNote: 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.Requires: 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.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.Effects: Reprocesses all values hold by *this, recalculating their hash values and redistributing them though the buckets.If store_hash option is true, this method uses the hash function and updates the stored hash value.Complexity: Average case linear in this->size(), worst case quadratic.Throws: If the hasher functor throws. Basic guarantee. boolbooltrueRequires:Effects:Complexity:Throws:Note: this method is only available if incremental<true> option is activated. grow boolconst bucket_traits &Effects: If new_bucket_traits.bucket_count() is not this->bucket_count()/2 or this->bucket_count()*2, or this->split_bucket() != new_bucket_traits.bucket_count() returns false and does nothing.Otherwise, copy assigns new_bucket_traits to the internal bucket_traits and transfers all the objects from old buckets to the new ones.Complexity: Linear to size().Throws: NothingNote: this method is only available if incremental<true> option is activated. size_typeRequires: incremental<> option must be setEffects: returns the current split countComplexity: ConstantThrows: Nothing const bucket_traits &const hasher &hasher()const key_equal &key_equal()const value_traits &value_traits()Requires: buckets must not be being used by any other resource.Effects: Constructs an empty unordered_set, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.Complexity: Constant.Throws: 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.Notes: buckets array must be disposed only after *this is disposed. boolIteratorIteratorconst bucket_traits &const hasher &hasher()const key_equal &key_equal()const value_traits &value_traits()Requires: buckets must not be being used by any other resource and dereferencing iterator must yield an lvalue of type value_type.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: If N is distance(b, e): Average case is O(N) (with a good hash function and with buckets_len >= N),worst case O(N^2).Throws: 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.Notes: buckets array must be disposed only after *this is disposed. hashtable &&Effects: 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.Complexity: Constant.Throws: 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. hashtable &hashtable &&Effects: Equivalent to swap. Effects: Detaches all elements from this. The objects in the unordered_set are not deleted (i.e. no destructors are called).Complexity: Linear to the number of elements in the unordered_set, if it's a safe-mode or auto-unlink value. Otherwise constant.Throws: Nothing. local_iteratorreferenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_local_iteratorconst_referenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. size_typesize_typeEffects: 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.Complexity: Amortized constant time.Throws: Nothing. size_typesize_typeEffects: 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.Complexity: Amortized constant time.Throws: Nothing. Helper metafunction to define a hashtable that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined
This header file forward declares most Intrusive classes.It forward declares the following containers and hooks: boost::intrusive::slist / boost::intrusive::slist_base_hook / boost::intrusive::slist_member_hook boost::intrusive::list / boost::intrusive::list_base_hook / boost::intrusive::list_member_hook boost::intrusive::bstree / boost::intrusive::bs_set / boost::intrusive::bs_multiset / boost::intrusive::bs_set_base_hook / boost::intrusive::bs_set_member_hook boost::intrusive::rbtree / boost::intrusive::set / boost::intrusive::multiset / boost::intrusive::set_base_hook / boost::intrusive::set_member_hook boost::intrusive::avltree / boost::intrusive::avl_set / boost::intrusive::avl_multiset / boost::intrusive::avl_set_base_hook / boost::intrusive::avl_set_member_hook boost::intrusive::splaytree / boost::intrusive::splay_set / boost::intrusive::splay_multiset boost::intrusive::sgtree / boost::intrusive::sg_set / boost::intrusive::sg_multiset boost::intrusive::treap / boost::intrusive::treap_set / boost::intrusive::treap_multiset boost::intrusive::hashtable / boost::intrusive::unordered_set / boost::intrusive::unordered_multiset / boost::intrusive::unordered_set_base_hook / boost::intrusive::unordered_set_member_hook / boost::intrusive::any_base_hook / boost::intrusive::any_member_hook It forward declares the following container or hook options: boost::intrusive::constant_time_size / boost::intrusive::size_type / boost::intrusive::compare / boost::intrusive::equal boost::intrusive::floating_point / boost::intrusive::priority / boost::intrusive::hash boost::intrusive::value_traits / boost::intrusive::member_hook / boost::intrusive::function_hook / boost::intrusive::base_hook boost::intrusive::void_pointer / boost::intrusive::tag / boost::intrusive::link_mode boost::intrusive::optimize_size / boost::intrusive::linear / boost::intrusive::cache_last boost::intrusive::bucket_traits / boost::intrusive::store_hash / boost::intrusive::optimize_multikey boost::intrusive::power_2_buckets / boost::intrusive::cache_begin / boost::intrusive::compare_hash / boost::intrusive::incremental It forward declares the following value traits utilities: boost::intrusive::value_traits / boost::intrusive::derivation_value_traits / boost::intrusive::trivial_value_traits Finally it forward declares the following general purpose utilities: boost::intrusive::pointer_plus_bits / boost::intrusive::priority_compare.
linear_slist_algorithms provides basic algorithms to manipulate nodes forming a linear singly linked list.linear_slist_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:Typedefs:node: The type of the node that forms the linear listnode_ptr: A pointer to a nodeconst_node_ptr: A pointer to a const nodeStatic functions:static node_ptr get_next(const_node_ptr n);static void set_next(node_ptr n, node_ptr next); NodeTraits::node NodeTraits::node_ptr NodeTraits::const_node_ptr NodeTraits voidconst node_ptr &Effects: Constructs an non-used list element, putting the next pointer to null: NodeTraits::get_next(this_node) == node_ptr()Complexity: ConstantThrows: Nothing. boolconst_node_ptrRequires: this_node must be in a circular list or be an empty circular list.Effects: Returns true is "this_node" is the only node of a circular list: or it's a not inserted node: return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_nodeComplexity: ConstantThrows: Nothing. boolconst_node_ptrEffects: Returns true is "this_node" has the same state as if it was inited using "init(node_ptr)"Complexity: ConstantThrows: Nothing. voidconst node_ptr &Requires: prev_node must be in a circular list or be an empty circular list.Effects: Unlinks the next node of prev_node from the circular list.Complexity: ConstantThrows: Nothing. voidconst node_ptr &const node_ptr &Requires: prev_node and last_node must be in a circular list or be an empty circular list.Effects: Unlinks the range (prev_node, last_node) from the linear list.Complexity: ConstantThrows: Nothing. voidconst node_ptr &const node_ptr &Requires: prev_node must be a node of a linear list.Effects: Links this_node after prev_node in the linear list.Complexity: ConstantThrows: Nothing. voidconst node_ptr &const node_ptr &const node_ptr &Requires: 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.Effects: Removes the nodes from (b, e] range from their linear list and inserts them after p in p's linear list.Complexity: ConstantThrows: Nothing. voidconst node_ptr &Effects: Constructs an empty list, making this_node the only node of the circular list: NodeTraits::get_next(this_node) == this_node.Complexity: ConstantThrows: Nothing. node_ptrconst node_ptr &const node_ptr &Requires: this_node and prev_init_node must be in the same linear list.Effects: 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).Complexity: Linear to the number of elements between prev_init_node and this_node.Throws: Nothing. std::size_tconst const_node_ptr &Requires: this_node must be in a linear list or be an empty linear list.Effects: Returns the number of nodes in a linear list. If the linear list is empty, returns 1.Complexity: LinearThrows: Nothing. voidnode_ptrnode_ptrRequires: this_node and other_node must be nodes inserted in linear lists or be empty linear lists.Effects: Moves all the nodes previously chained after this_node after other_node and vice-versa.Complexity: ConstantThrows: Nothing. node_ptrnode_ptrEffects: Reverses the order of elements in the list.Returns: The new first node of the list.Throws: Nothing.Complexity: This function is linear to the contained elements. std::pair< node_ptr, node_ptr >node_ptrstd::size_tEffects: Moves the first n nodes starting at p to the end of the list.Returns: 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.Throws: Nothing.Complexity: Linear to the number of elements plus the number moved positions. std::pair< node_ptr, node_ptr >node_ptrstd::size_tEffects: Moves the first n nodes starting at p to the beginning of the list.Returns: 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.Throws: Nothing.Complexity: Linear to the number of elements plus the number moved positions.
If this linking policy is specified in a value_traits class as the link_mode, containers configured with such value_traits 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. If this linking policy is specified in a value_traits class as the link_mode, containers configured with such value_traits 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. 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 value_traits 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. This enumeration defines the type of value_traits that can be defined for Boost.Intrusive containers
The class template list is an intrusive container that mimics most of the interface of std::list as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<> and size_type<>. ValueTraits value_traits::pointer value_traits::const_pointer pointer_traits< pointer >::element_type pointer_traits< pointer >::reference pointer_traits< const_pointer >::reference pointer_traits< pointer >::difference_type SizeType list_iterator< value_traits, false > list_iterator< value_traits, true > boost::intrusive::reverse_iterator< iterator > boost::intrusive::reverse_iterator< const_iterator > value_traits::node_traits node_traits::node node_traits::node_ptr node_traits::const_node_ptr circular_list_algorithms< node_traits > unspecified const bool const bool const bool voidreferenceRequires: value must be an lvalue.Effects: Inserts the value in the back of the list. No copy constructors are called.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. voidreferenceRequires: value must be an lvalue.Effects: Inserts the value in the front of the list. No copy constructors are called.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. voidEffects: Erases the last element of the list. No destructors are called.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators (but not the references) to the erased element. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the last element of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators to the erased element. voidEffects: Erases the first element of the list. No destructors are called.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators (but not the references) to the erased element. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the first element of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators to the erased element. referenceEffects: Returns a reference to the first element of the list.Throws: Nothing.Complexity: Constant. const_referenceEffects: Returns a const_reference to the first element of the list.Throws: Nothing.Complexity: Constant. referenceEffects: Returns a reference to the last element of the list.Throws: Nothing.Complexity: Constant. const_referenceEffects: Returns a const_reference to the last element of the list.Throws: Nothing.Complexity: Constant. iteratorEffects: Returns an iterator to the first element contained in the list.Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns a const_iterator to the first element contained in the list.Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns a const_iterator to the first element contained in the list.Throws: Nothing.Complexity: Constant. iteratorEffects: Returns an iterator to the end of the list.Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns a const_iterator to the end of the list.Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns a constant iterator to the end of the list.Throws: Nothing.Complexity: Constant. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed list.Throws: Nothing.Complexity: Constant. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed list.Throws: Nothing.Complexity: Constant. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed list.Throws: Nothing.Complexity: Constant. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed list.Throws: Nothing.Complexity: Constant. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed list.Throws: Nothing.Complexity: Constant. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed list.Throws: Nothing.Complexity: Constant. size_typeEffects: Returns the number of the elements contained in the list.Throws: Nothing.Complexity: Linear to the number of elements contained in the list. if constant-time size option is disabled. Constant time otherwise.Note: Does not affect the validity of iterators and references. boolEffects: Returns true if the list contains no elements.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. voidlist &Effects: Swaps the elements of x and *this.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. voidsize_type1Effects: 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.Throws: Nothing.Complexity: Linear to the number of shifts.Note: Does not affect the validity of iterators and references. voidsize_type1Effects: 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.Throws: Nothing.Complexity: Linear to the number of shifts.Note: Does not affect the validity of iterators and references. iteratorconst_iteratorEffects: Erases the element pointed by i of the list. No destructors are called.Returns: the first element remaining beyond the removed element, or end() if no such element exists.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators (but not the references) to the erased element. iteratorconst_iteratorconst_iteratorRequires: b and e must be valid iterators to elements in *this.Effects: Erases the element range pointed by b and e No destructors are called.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: 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.Note: Invalidates the iterators (but not the references) to the erased elements. iteratorconst_iteratorconst_iteratorsize_typeRequires: b and e must be valid iterators to elements in *this. n must be distance(b, e).Effects: Erases the element range pointed by b and e No destructors are called.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: Linear to the number of erased elements if it's a safe-mode or auto-unlink value is enabled. Constant-time otherwise.Note: Invalidates the iterators (but not the references) to the erased elements. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed by i of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.Returns: the first element remaining beyond the removed element, or end() if no such element exists.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators to the erased element. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element range pointed by b and e No destructors are called. Disposer::operator()(pointer) is called for the removed elements.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: Linear to the number of elements erased.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all the elements of the container. No destructors are called.Throws: Nothing.Complexity: Linear to the number of elements of the list. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Note: Invalidates the iterators (but not the references) to the erased elements. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements of the container. No destructors are called. Disposer::operator()(pointer) is called for the removed elements.Throws: Nothing.Complexity: Linear to the number of elements of the list.Note: Invalidates the iterators to the erased elements. voidconst list &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws. Basic guarantee. voidlist &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws. Basic guarantee. iteratorconst_iteratorreferenceRequires: value must be an lvalue and p must be a valid iterator of *this.Effects: Inserts the value before the position pointed by p.Returns: An iterator to the inserted element.Throws: Nothing.Complexity: Constant time. No copy constructors are called.Note: Does not affect the validity of iterators and references. voidconst_iteratorIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type and p must be a valid iterator of *this.Effects: Inserts the range pointed by b and e before the position p. No copy constructors are called.Throws: Nothing.Complexity: Linear to the number of elements inserted.Note: Does not affect the validity of iterators and references. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called.Throws: Nothing.Complexity: 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.Note: Invalidates the iterators (but not the references) to the erased elements. voidDisposerIteratorIteratorRequires: Disposer::operator()(pointer) shouldn't throw.Requires: Dereferencing iterator must yield an lvalue of type value_type.Effects: 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.Throws: Nothing.Complexity: Linear to the number of elements inserted plus linear to the elements contained in the list.Note: Invalidates the iterators (but not the references) to the erased elements. voidconst_iteratorlist &Requires: p must be a valid iterator of *this.Effects: Transfers all the elements of list x to this list, before the the element pointed by p. No destructors or copy constructors are called.Throws: Nothing.Complexity: Constant.Note: 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. voidconst_iteratorlist &const_iteratorRequires: p must be a valid iterator of *this. new_ele must point to an element contained in list x.Effects: 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.Throws: Nothing.Complexity: Constant.Note: 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. voidconst_iteratorlist &const_iteratorconst_iteratorRequires: p must be a valid iterator of *this. f and e must point to elements contained in list x.Effects: 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.Throws: Nothing.Complexity: Linear to the number of elements transferred if constant-time size option is enabled. Constant-time otherwise.Note: 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. voidconst_iteratorlist &const_iteratorconst_iteratorsize_typeRequires: p must be a valid iterator of *this. f and e must point to elements contained in list x. n == distance(f, e)Effects: 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.Throws: Nothing.Complexity: Constant.Note: 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. voidEffects: This function sorts the list *this according to std::less<value_type>. The sort is stable, that is, the relative order of equivalent elements is preserved.Throws: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or std::less<value_type> throws. Basic guarantee.Notes: Iterators and references are not invalidated.Complexity: The number of comparisons is approximately N log N, where N is the list's size. voidPredicateRequires: p must be a comparison function that induces a strict weak orderingEffects: This function sorts the list *this according to p. The sort is stable, that is, the relative order of equivalent elements is preserved.Throws: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the predicate throws. Basic guarantee.Notes: This won't throw if list_base_hook<> or list_member_hook are used. Iterators and references are not invalidated.Complexity: The number of comparisons is approximately N log N, where N is the list's size. voidlist &Effects: This function removes all of x's elements and inserts them in order into *this according to std::less<value_type>. 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.Throws: If std::less<value_type> throws. Basic guarantee.Complexity: This function is linear time: it performs at most size() + x.size() - 1 comparisons.Note: Iterators and references are not invalidated voidlist &PredicateRequires: 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.Effects: 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.Throws: If the predicate throws. Basic guarantee.Complexity: This function is linear time: it performs at most size() + x.size() - 1 comparisons.Note: Iterators and references are not invalidated. voidEffects: Reverses the order of elements in the list.Throws: Nothing.Complexity: This function is linear time.Note: Iterators and references are not invalidated voidconst_referenceEffects: Removes all the elements that compare equal to value. No destructors are called.Throws: If std::equal_to<value_type> throws. Basic guarantee.Complexity: Linear time. It performs exactly size() comparisons for equality.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidconst_referenceDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Removes all the elements that compare equal to value. Disposer::operator()(pointer) is called for every removed element.Throws: If std::equal_to<value_type> throws. Basic guarantee.Complexity: Linear time. It performs exactly size() comparisons for equality.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidPredEffects: Removes all the elements for which a specified predicate is satisfied. No destructors are called.Throws: If pred throws. Basic guarantee.Complexity: Linear time. It performs exactly size() calls to the predicate.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidPredDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Removes all the elements for which a specified predicate is satisfied. Disposer::operator()(pointer) is called for every removed element.Throws: If pred throws. Basic guarantee.Complexity: Linear time. It performs exactly size() comparisons for equality.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidEffects: Removes adjacent duplicate elements or adjacent elements that are equal from the list. No destructors are called.Throws: If std::equal_to<value_type throws. Basic guarantee.Complexity: Linear time (size()-1 comparisons calls to pred()).Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidBinaryPredicateEffects: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. No destructors are called.Throws: If pred throws. Basic guarantee.Complexity: Linear time (size()-1 comparisons equality comparisons).Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Removes adjacent duplicate elements or adjacent elements that are equal from the list. Disposer::operator()(pointer) is called for every removed element.Throws: If std::equal_to<value_type throws. Basic guarantee.Complexity: Linear time (size()-1) comparisons equality comparisons.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidBinaryPredicateDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. Disposer::operator()(pointer) is called for every removed element.Throws: If pred throws. Basic guarantee.Complexity: Linear time (size()-1) comparisons equality comparisons.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. iteratorreferenceRequires: value must be a reference to a value inserted in a list.Effects: This function returns a const_iterator pointing to the elementThrows: Nothing.Complexity: Constant time.Note: Iterators and references are not invalidated. const_iteratorconst_referenceRequires: value must be a const reference to a value inserted in a list.Effects: This function returns an iterator pointing to the element.Throws: Nothing.Complexity: Constant time.Note: Iterators and references are not invalidated. voidEffects: Asserts the integrity of the container.Complexity: Linear time.Note: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. Effects: constructs an empty list.Complexity: ConstantThrows: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). const value_traits &Effects: constructs an empty list.Complexity: ConstantThrows: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). IteratorIteratorconst value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Constructs a list equal to the range [first,last).Complexity: Linear in distance(b, e). No copy constructors are called.Throws: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). list &&Effects: 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.Complexity: Constant.Throws: 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. list &list &&Effects: Equivalent to swap Effects: 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.Complexity: Linear to the number of elements in the list, if it's a safe-mode or auto-unlink value . Otherwise constant. list &iteratorPrecondition: end_iterator must be a valid end iterator of list.Effects: Returns a const reference to the list associated to the end iteratorThrows: Nothing.Complexity: Constant. const list &const_iteratorPrecondition: end_iterator must be a valid end const_iterator of list.Effects: Returns a const reference to the list associated to the end iteratorThrows: Nothing.Complexity: Constant. iteratorreferenceRequires: value must be a reference to a value inserted in a list.Effects: This function returns a const_iterator pointing to the elementThrows: Nothing.Complexity: Constant time.Note: Iterators and references are not invalidated. This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be a const reference to a value inserted in a list.Effects: This function returns an iterator pointing to the element.Throws: Nothing.Complexity: Constant time.Note: Iterators and references are not invalidated. This static function is available only if the value traits is stateless. Helper metafunction to define a list that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined
make_list_base_hook::type< O1, O2, O3 >Derive a class from this hook in order to store objects of that class in an list.The hook admits the following options: tag<>, void_pointer<> and link_mode<>.tag<> 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 list_base_hook, then each list_base_hook needs its unique tag.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook. voidlist_base_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether list::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const list_base_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. list_base_hook &const list_base_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in an list an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing. make_list_member_hook::type< O1, O2, O3 >Store this hook in a class to be inserted in an list.The hook admits the following options: void_pointer<> and link_mode<>.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook. voidlist_member_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether list::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const list_member_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. list_member_hook &const list_member_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in an list an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing. Helper metafunction to define a list_base_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a list_member_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined
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 NodeTraits T node_traits::node node_traits::node_ptr node_traits::const_node_ptr pointer_traits< node_ptr > pointer_traits< node_ptr >::template rebind_pointer< T >::type pointer_traits< node_ptr >::template rebind_pointer< const T >::type value_type & const value_type & const link_mode_type node_ptrreference const_node_ptrconst_reference pointerconst node_ptr & const_pointerconst const_node_ptr &
This option setter specifies that the container must use the specified base hook 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 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). 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 &) for circular slists and makes possible new functions like push_back(reference) and back(). This option setter specifies the strict weak ordering comparison functor for the value type This option setter specifies if the container will compare the hash value before comparing objects. This option can't be specified if store_hash<> 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. This option setter specifies if the intrusive container stores its size as a member to obtain constant-time size() member. This option setter specifies the equality functor for the value type 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.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.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. 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. This option setter specifies the hash functor for the value type This option setter specifies a container header holder type. 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. 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.This function object must the define a type member typedef and a member with signature type [const&] operator()(const value_type &) const that will return the key from a value_type of an associative container This option setter specifies if the slist container should use a linear implementation instead of a circular one. This option setter specifies the link mode (normal_link, safe_link or auto_unlink) This option setter specifies the member hook the container must use. 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 unordered_multiset containers with a great number of elements with the same key. This option setter specifies if the hook should be optimized for size instead of for speed. 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. This option setter specifies the priority comparison functor for the value type 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.This function object must the define a type member typedef and a member with signature type [const&] operator()(const value_type &) const that will return the priority from a value_type of a treap container This option setter specifies the type that the container will use to store its size. 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. 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 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. 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
This class is a utility that takes: a default options class defining initial static constant and typedefs several options defined with BOOST_INTRUSIVE_OPTION_CONSTANT and BOOST_INTRUSIVE_OPTION_TYPE and packs them together in a new type that defines all options as member typedefs or static constant values. Given options of form:BOOST_INTRUSIVE_OPTION_TYPE(my_pointer, VoidPointer, VoidPointer, my_pointer_type) BOOST_INTRUSIVE_OPTION_CONSTANT(incremental, bool, Enabled, is_incremental) the following expressionstruct default_options { typedef long int_type; static const int int_constant = -1; }; pack_options< default_options, my_pointer<void*>, incremental<true> >::type will create a type that will contain the following typedefs/constantsstruct unspecified_type { //Default options typedef long int_type; static const int int_constant = -1; //Packed options (will ovewrite any default option) typedef void* my_pointer_type; static const bool is_incremental = true; }; If an option is specified in the default options argument and later redefined as an option, the last definition will prevail. unspecified_type Defines an option class of name OPTION_NAME that can be used to specify a type of type TYPE...struct OPTION_NAME<class TYPE> { unspecified_content }; ...that after being combined with boost::intrusive::pack_options, will typedef TYPE as a typedef of name TYPEDEF_NAME. Example://[includes and namespaces omitted for brevity] //This macro will create the following class: // template<class VoidPointer> // struct my_pointer // { unspecified_content }; BOOST_INTRUSIVE_OPTION_TYPE(my_pointer, VoidPointer, boost::remove_pointer<VoidPointer>::type, my_pointer_type) struct empty_default{}; typedef pack_options< empty_default, typename my_pointer<void*> >::type::my_pointer_type type; BOOST_STATIC_ASSERT(( boost::is_same<type, void>::value )); Defines an option class of name OPTION_NAME that can be used to specify a constant of type TYPE with value VALUE...struct OPTION_NAME<TYPE VALUE> { unspecified_content }; ...that after being combined with boost::intrusive::pack_options, will contain a CONSTANT_NAME static constant of value VALUE. Example://[includes and namespaces omitted for brevity] //This macro will create the following class: // template<bool Enabled> // struct incremental // { unspecified_content }; BOOST_INTRUSIVE_OPTION_CONSTANT(incremental, bool, Enabled, is_incremental) struct empty_default{}; const bool is_incremental = pack_options< empty_default, incremental<true> >::type::is_incremental; BOOST_STATIC_ASSERT(( is_incremental == true ));
Parent *Member *const Member Parent::*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. const Parent *const Member *const Member Parent::*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.
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. const std::size_t void *AlignmentThis is a specialization for raw pointers. Raw pointers can embed extra bits in the lower bits if the alignment is multiple of 2pow(NumBits). const std::size_t 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.An implementation that detects that a pointer type whose has_pointer_plus_bits<>::value is non-zero can make use of these operations to embed the bits in the pointer. T *NumBitsThis 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. T * const uintptr_t pointerpointer voidpointer &pointer std::size_tpointer voidpointer &std::size_t
const V & const bool charinttypename X::template rebind< U > * intany< int >void * const V & const bool charinttypename X::template rebind< U >::other * intany< int >void * boost::intrusive::pointer_rebinder< Ptr, U, pointer_rebind_mode< Ptr, U >::mode >defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) T *UU * const unsigned int const unsigned int const unsigned int PtrU1uPtr::template rebind< U > PtrU2uPtr::template rebind< U >::other Ptr< A >U0uPtr< U > Ptr< AAn... >U0uPtr< U, An... >
pointer_traits is the implementation of C++11 std::pointer_traits class with some extensions like castings.pointer_traits supplies a uniform interface to certain attributes of pointer-like types.Note: 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 pointer_traits interface (*_cast_from and pointer_to) can properly convert between const and nonconst referred member types without the use of implicit constructor calls. It is suggested these conversions be implemented as function templates, where the template argument is the type of the object being converted from. The pointer type queried by this pointer_traits instantiation Ptr Ptr::element_type if such a type exists; otherwise, T if Ptr is a class template instantiation of the form SomePointer<T, Args>, where Args is zero or more type arguments ; otherwise , the specialization is ill-formed. unspecified_type Ptr::difference_type if such a type exists; otherwise, std::ptrdiff_t. unspecified_type Ptr::rebind<U> if such a type exists; otherwise, SomePointer<U, Args> if Ptr is a class template instantiation of the form SomePointer<T, Args>, where Args is zero or more type arguments ; otherwise, the instantiation of rebind is ill-formed.For portable code for C++03 and C++11, typename rebind_pointer<U>::type shall be used instead of rebind to obtain a pointer to U. unspecified Ptr::reference if such a type exists (non-standard extension); otherwise, element_type & unspecified_type pointerreferenceRemark: If element_type is (possibly cv-qualified) void, r type is unspecified; otherwise, it is element_type &.Returns: 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));Note: For non-conforming compilers only the existence of a member function called pointer_to is checked. pointerconst UPtr &Remark: Non-standard extension.Returns: A dereferenceable pointer to r obtained by calling the static template function Ptr::static_cast_from(UPpr/const UPpr &). If such function does not exist, returns pointer_to(static_cast<element_type&>(*uptr))Note: For non-conforming compilers only the existence of a member function called static_cast_from is checked. pointerconst UPtr &Remark: Non-standard extension.Returns: A dereferenceable pointer to r obtained by calling the static template function Ptr::const_cast_from<UPtr>(UPpr/const UPpr &). If such function does not exist, returns pointer_to(const_cast<element_type&>(*uptr))Note: For non-conforming compilers only the existence of a member function called const_cast_from is checked. pointerconst UPtr &Remark: Non-standard extension.Returns: A dereferenceable pointer to r obtained by calling the static template function Ptr::dynamic_cast_from<UPtr>(UPpr/const UPpr &). If such function does not exist, returns pointer_to(dynamic_cast<element_type>(&*uptr))Note: For non-conforming compilers only the existence of a member function called dynamic_cast_from is checked. T *Specialization of pointer_traits for raw pointers U * T T * std::ptrdiff_t T & U *For portable code for C++03 and C++11, typename rebind_pointer<U>::type shall be used instead of rebind to obtain a pointer to U. U * pointerreferenceReturns: addressof(r) pointerU *Returns: static_cast<pointer>(uptr) pointerU *Returns: const_cast<pointer>(uptr) pointerU *Returns: dynamic_cast<pointer>(uptr)
T T bool boolconst T &const T & void boolconst T &const U &
Helper metafunction to define a rbtree that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined 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.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. ValueTraits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms implementation_defined::insert_commit_data const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidrbtree &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst rbtree &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidrbtree &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. voidrbtree &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidrbtree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidrbtree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. boolIteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. rbtree &&Effects: 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.Complexity: Constant.Throws: 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. rbtree &rbtree &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. rbtree &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const rbtree &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. rbtree &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const rbtree &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks.
rbtree_algorithms 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(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.);(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.rbtree_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:Typedefs:node: The type of the node that forms the binary search treenode_ptr: A pointer to a nodeconst_node_ptr: A pointer to a const nodecolor: The type that can store the color of a nodeStatic functions:static node_ptr get_parent(const_node_ptr n);static void set_parent(node_ptr n, node_ptr parent);static node_ptr get_left(const_node_ptr n);static void set_left(node_ptr n, node_ptr left);static node_ptr get_right(const_node_ptr n);static void set_right(node_ptr n, node_ptr right);static color get_color(const_node_ptr n);static void set_color(node_ptr n, color c);static color black();static color red(); NodeTraits NodeTraits::node NodeTraits::node_ptr NodeTraits::const_node_ptr NodeTraits::color This type is the information that will be filled by insert_unique_check bstree_algo::insert_commit_data node_ptrconst const_node_ptr &Requires: 'node' is a node of the tree or a header node.Effects: Returns the header of the tree.Complexity: Logarithmic.Throws: Nothing. node_ptrconst const_node_ptr &Requires: 'header' is the header node of a tree.Effects: Returns the first node of the tree, the header if the tree is empty.Complexity: Constant time.Throws: Nothing. node_ptrconst const_node_ptr &Requires: 'header' is the header node of a tree.Effects: Returns the header of the tree.Complexity: Constant time.Throws: Nothing. voidnode_ptrnode_ptrRequires: header1 and header2 must be the header nodes of two trees.Effects: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.Complexity: Constant.Throws: Nothing. voidnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees.Effects: 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.Complexity: Logarithmic.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees with header header1 and header2.Effects: 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.Complexity: Constant.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Logarithmic.Throws: Nothing.Note: 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 voidnode_ptrnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Constant.Throws: Nothing.Note: 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 voidconst node_ptr &Requires: node is a tree node but not the header.Effects: Unlinks the node and rebalances the tree.Complexity: Average complexity is constant time.Throws: Nothing. node_ptrconst node_ptr &Requires: header is the header of a tree.Effects: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. boolconst const_node_ptr &Requires: 'node' is a node of the tree or a node initialized by init(...) or init_node.Effects: Returns true if the node is initialized by init() or init_node().Complexity: Constant time.Throws: Nothing. std::size_tconst const_node_ptr &Requires: node is a node of the tree but it's not the header.Effects: Returns the number of nodes of the subtree.Complexity: Linear time.Throws: Nothing. node_ptrconst node_ptr &Requires: 'node' is a node from the tree except the header.Effects: Returns the next node of the tree.Complexity: Average constant time.Throws: Nothing. node_ptrconst node_ptr &Requires: 'node' is a node from the tree except the leftmost node.Effects: Returns the previous node of the tree.Complexity: Average constant time.Throws: Nothing. voidconst node_ptr &Requires: 'node' must not be part of any tree.Effects: After the function unique(node) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. voidnode_ptrRequires: node must not be part of any tree.Effects: Initializes the header to represent an empty tree. unique(header) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. node_ptrnode_ptrnode_ptrRequires: header must be the header of a tree, z a node of that tree and z != header.Effects: Erases node "z" from the tree with header "header".Complexity: Amortized constant time.Throws: Nothing. boolnode_ptrNodePtrComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.Returns: True if the node was trasferred, false otherwise.Complexity: Logarithmic.Throws: If the comparison throws. voidnode_ptrNodePtrComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2.Complexity: Logarithmic.Throws: If the comparison throws. voidconst_node_ptrnode_ptrClonerDisposerRequires: "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.Effects: First empties target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Then, duplicates the entire tree pointed by "source_header" cloning each source node with node_ptr Cloner::operator()(const node_ptr &) to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using void disposer(const node_ptr &).Complexity: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. voidconst node_ptr &DisposerRequires: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.Effects: Empties the target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Complexity: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. node_ptrconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const const_node_ptr &const KeyType &const KeyType &KeyNodePtrCompareboolboolRequires: "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.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If "comp" throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change. std::size_tconst const_node_ptr &const KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns the number of elements with a key equivalent to "key" according to "comp".Complexity: Logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: Inserts new_node into the tree before the upper bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: Inserts new_node into the tree before the lower bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: 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).Complexity: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".Throws: If "comp" throws. node_ptrnode_ptrnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. voidnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". voidnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". std::pair< node_ptr, bool >const_node_ptrconst KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. std::pair< node_ptr, bool >const_node_ptrnode_ptrconst KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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).Returns: 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.Complexity: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. voidnode_ptrnode_ptrconst insert_commit_data &Requires: "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".Effects: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.Complexity: Constant time.Throws: Nothing.Notes: 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. boolconst const_node_ptr &Requires: p is a node of a tree.Effects: Returns true if p is the header of the tree.Complexity: Constant.Throws: Nothing.
Helper metafunction to define a multiset that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a set that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined The class template multiset is an intrusive container, that mimics most of the interface of std::multiset as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidmultiset &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst multiset &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidmultiset &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidmultiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. multiset &&Effects: 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.Complexity: Constant.Throws: 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. multiset &multiset &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. multiset &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const multiset &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. multiset &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const multiset &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. The class template set is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidset &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst set &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidset &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidmultiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. set &&Effects: 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.Complexity: Constant.Throws: 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. set &set &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. set &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const set &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. set &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const set &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. boolconst set< T, Options... > &const set< T, Options... > & boolconst set< T, Options... > &const set< T, Options... > & boolconst set< T, Options... > &const set< T, Options... > & boolconst set< T, Options... > &const set< T, Options... > & voidset< T, Options... > &set< T, Options... > & boolconst multiset< T, Options... > &const multiset< T, Options... > & boolconst multiset< T, Options... > &const multiset< T, Options... > & boolconst multiset< T, Options... > &const multiset< T, Options... > & boolconst multiset< T, Options... > &const multiset< T, Options... > & voidmultiset< T, Options... > &multiset< T, Options... > &
Helper metafunction to define a set_base_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a set_member_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined make_set_base_hook::type< O1, O2, O3, O4 >Derive a class from set_base_hook in order to store objects in in a set/multiset. set_base_hook holds the data necessary to maintain the set/multiset and provides an appropriate value_traits class for set/multiset.The hook admits the following options: tag<>, void_pointer<>, link_mode<> and optimize_size<>.tag<> 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 list_base_hook, then each list_base_hook needs its unique tag.void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).optimize_size<> will tell the hook to optimize the hook for size instead of speed. voidset_base_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether set::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const set_base_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. set_base_hook &const set_base_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in a set an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing. make_set_member_hook::type< O1, O2, O3, O4 >Put a public data member set_member_hook in order to store objects of this class in a set/multiset. set_member_hook holds the data necessary for maintaining the set/multiset and provides an appropriate value_traits class for set/multiset.The hook admits the following options: void_pointer<>, link_mode<> and optimize_size<>.void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).optimize_size<> will tell the hook to optimize the hook for size instead of speed. voidset_member_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether set::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const set_member_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. set_member_hook &const set_member_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in a set an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing.
Helper metafunction to define a sg_multiset that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a sg_set that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined The class template sg_multiset is an intrusive container, that mimics most of the interface of std::sg_multiset as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, floating_point<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidsg_multiset &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst sg_multiset &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. voidsg_multiset &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. Additional notes: it also copies the alpha factor from the source container. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidEffects: Rebalances the tree.Throws: Nothing.Complexity: Linear. iteratoriteratorRequires: old_root is a node of a tree.Effects: Rebalances the subtree rooted at old_root.Returns: The new root of the subtree.Throws: Nothing.Complexity: Linear to the elements in the subtree. floatReturns: The balance factor (alpha) used in this treeThrows: Nothing.Complexity: Constant. voidfloatRequires: new_alpha must be a value between 0.5 and 1.0Effects: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.Throws: Nothing.Complexity: Linear to the elements in the subtree. voidsg_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidsg_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. sg_multiset &&Effects: 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.Complexity: Constant.Throws: 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. sg_multiset &sg_multiset &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. sg_multiset &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const sg_multiset &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. sg_multiset &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const sg_multiset &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. The class template sg_set is an intrusive container, that mimics most of the interface of std::sg_set as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, floating_point<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidsg_set &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst sg_set &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. voidsg_set &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. Additional notes: it also copies the alpha factor from the source container. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidEffects: Rebalances the tree.Throws: Nothing.Complexity: Linear. iteratoriteratorRequires: old_root is a node of a tree.Effects: Rebalances the subtree rooted at old_root.Returns: The new root of the subtree.Throws: Nothing.Complexity: Linear to the elements in the subtree. floatReturns: The balance factor (alpha) used in this treeThrows: Nothing.Complexity: Constant. voidfloatRequires: new_alpha must be a value between 0.5 and 1.0Effects: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.Throws: Nothing.Complexity: Linear to the elements in the subtree. voidsg_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidsg_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. sg_set &&Effects: 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.Complexity: Constant.Throws: 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. sg_set &sg_set &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. sg_set &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const sg_set &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. sg_set &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const sg_set &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. boolconst sg_set< T, Options... > &const sg_set< T, Options... > & boolconst sg_set< T, Options... > &const sg_set< T, Options... > & boolconst sg_set< T, Options... > &const sg_set< T, Options... > & boolconst sg_set< T, Options... > &const sg_set< T, Options... > & voidsg_set< T, Options... > &sg_set< T, Options... > & boolconst sg_multiset< T, Options... > &const sg_multiset< T, Options... > & boolconst sg_multiset< T, Options... > &const sg_multiset< T, Options... > & boolconst sg_multiset< T, Options... > &const sg_multiset< T, Options... > & boolconst sg_multiset< T, Options... > &const sg_multiset< T, Options... > & voidsg_multiset< T, Options... > &sg_multiset< T, Options... > &
Helper metafunction to define a sgtree that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined The class template sgtree is an intrusive scapegoat tree container, that is used to construct intrusive sg_set and sg_multiset containers. The no-throw guarantee holds only, if the value_compare object doesn't throw.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, floating_point<>, size_type<> and compare<>. ValueTraits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined implementation_defined const bool const bool const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidsgtree &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst sgtree &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. voidsgtree &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. Additional notes: it also copies the alpha factor from the source container. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator BOOST_INTRUSIVE_I bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. voidsgtree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) it !itend voidsgtree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) it !itend size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidEffects: Rebalances the tree.Throws: Nothing.Complexity: Linear. iteratoriteratorRequires: old_root is a node of a tree.Effects: Rebalances the subtree rooted at old_root.Returns: The new root of the subtree.Throws: Nothing.Complexity: Linear to the elements in the subtree. floatReturns: The balance factor (alpha) used in this treeThrows: Nothing.Complexity: Constant. voidfloatRequires: new_alpha must be a value between 0.5 and 1.0Effects: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.Throws: Nothing.Complexity: Linear to the elements in the subtree. Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. boolIteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. sgtree &&Effects: 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.Complexity: Constant.Throws: 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. sgtree &sgtree &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. sgtree &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const sgtree &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. sgtree &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const sgtree &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks.
sgtree_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:Typedefs:node: The type of the node that forms the binary search treenode_ptr: A pointer to a nodeconst_node_ptr: A pointer to a const nodeStatic functions:static node_ptr get_parent(const_node_ptr n);static void set_parent(node_ptr n, node_ptr parent);static node_ptr get_left(const_node_ptr n);static void set_left(node_ptr n, node_ptr left);static node_ptr get_right(const_node_ptr n);static void set_right(node_ptr n, node_ptr right); insert_commit_dataThis type is the information that will be filled by insert_unique_check std::size_t NodeTraits::node NodeTraits NodeTraits::node_ptr NodeTraits::const_node_ptr node_ptrconst_node_ptrRequires: 'node' is a node of the tree or a header node.Effects: Returns the header of the tree.Complexity: Logarithmic.Throws: Nothing. node_ptrconst_node_ptrRequires: 'header' is the header node of a tree.Effects: Returns the first node of the tree, the header if the tree is empty.Complexity: Constant time.Throws: Nothing. node_ptrconst_node_ptrRequires: 'header' is the header node of a tree.Effects: Returns the header of the tree.Complexity: Constant time.Throws: Nothing. voidnode_ptrnode_ptrRequires: header1 and header2 must be the header nodes of two trees.Effects: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.Complexity: Constant.Throws: Nothing. voidnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees.Effects: 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.Complexity: Logarithmic.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees with header header1 and header2.Effects: 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.Complexity: Constant.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Logarithmic.Throws: Nothing.Note: 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 voidnode_ptrnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Constant.Throws: Nothing.Note: 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 node_ptrnode_ptrstatic void unlink(node_ptr node); Requires: header is the header of a tree.Effects: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. boolconst_node_ptrRequires: 'node' is a node of the tree or a node initialized by init(...) or init_node.Effects: Returns true if the node is initialized by init() or init_node().Complexity: Constant time.Throws: Nothing. std::size_tconst_node_ptrRequires: node is a node of the tree but it's not the header.Effects: Returns the number of nodes of the subtree.Complexity: Linear time.Throws: Nothing. node_ptrnode_ptrRequires: 'node' is a node from the tree except the header.Effects: Returns the next node of the tree.Complexity: Average constant time.Throws: Nothing. node_ptrnode_ptrRequires: 'node' is a node from the tree except the leftmost node.Effects: Returns the previous node of the tree.Complexity: Average constant time.Throws: Nothing. voidnode_ptrRequires: 'node' must not be part of any tree.Effects: After the function unique(node) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. voidnode_ptrRequires: node must not be part of any tree.Effects: Initializes the header to represent an empty tree. unique(header) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. node_ptrnode_ptrnode_ptrstd::size_tstd::size_t &AlphaByMaxSizeRequires: header must be the header of a tree, z a node of that tree and z != header.Effects: Erases node "z" from the tree with header "header".Complexity: Amortized constant time.Throws: Nothing. voidconst_node_ptrnode_ptrClonerDisposerRequires: "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.Effects: First empties target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Then, duplicates the entire tree pointed by "source_header" cloning each source node with node_ptr Cloner::operator()(const node_ptr &) to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using void disposer(const node_ptr &).Complexity: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. voidnode_ptrDisposerRequires: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.Effects: Empties the target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Complexity: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. node_ptrconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const_node_ptrconst KeyType &const KeyType &KeyNodePtrCompareboolboolRequires: "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.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If "comp" throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change. std::size_tconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns the number of elements with a key equivalent to "key" according to "comp".Complexity: Logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrNodePtrComparestd::size_tH_Alphastd::size_t &Requires: "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.Effects: Inserts new_node into the tree before the upper bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrNodePtrComparestd::size_tH_Alphastd::size_t &Requires: "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.Effects: Inserts new_node into the tree before the lower bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrnode_ptrNodePtrComparestd::size_tH_Alphastd::size_t &Requires: "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.Effects: 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).Complexity: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".Throws: If "comp" throws. node_ptrnode_ptrnode_ptrnode_ptrstd::size_tH_Alphastd::size_t &Requires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. voidnode_ptrnode_ptrstd::size_tH_Alphastd::size_t &Requires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". voidnode_ptrnode_ptrstd::size_tH_Alphastd::size_t &Requires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". std::pair< node_ptr, bool >const_node_ptrconst KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. std::pair< node_ptr, bool >const_node_ptrnode_ptrconst KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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).Returns: 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.Complexity: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. voidnode_ptrnode_ptrconst insert_commit_data &std::size_tH_Alphastd::size_t &Requires: "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".Effects: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.Complexity: Constant time.Throws: Nothing.Notes: 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. boolnode_ptrNodePtrComparestd::size_tstd::size_t &node_ptrnode_ptrstd::size_tstd::size_t &H_AlphaAlphaByMaxSizeRequires: 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..Effects: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.Returns: True if the node was trasferred, false otherwise.Complexity: Logarithmic.Throws: If the comparison throws. voidnode_ptrNodePtrComparestd::size_tstd::size_t &node_ptrnode_ptrstd::size_tstd::size_t &H_AlphaAlphaByMaxSizeRequires: 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..Effects: Transfers node "z" from tree1 to tree2.Complexity: Logarithmic.Throws: If the comparison throws. boolconst_node_ptrRequires: p is a node of a tree.Effects: Returns true if p is the header of the tree.Complexity: Constant.Throws: Nothing. voidnode_ptrRequires: p is a node of a tree.Effects: Returns true if p is the header of the tree.Complexity: Constant.Throws: Nothing.
Helper metafunction to define a slist that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined 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.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<>, linear<> and cache_last<>.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() ValueTraits value_traits::pointer value_traits::const_pointer pointer_traits< pointer >::element_type pointer_traits< pointer >::reference pointer_traits< const_pointer >::reference pointer_traits< pointer >::difference_type SizeType slist_iterator< value_traits, false > slist_iterator< value_traits, true > value_traits::node_traits node_traits::node node_traits::node_ptr node_traits::const_node_ptr unspecified unspecified const bool const bool const bool const bool const bool voidEffects: Erases all the elements of the container.Throws: Nothing.Complexity: Linear to the number of elements of the list. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Note: Invalidates the iterators (but not the references) to the erased elements. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements of the container Disposer::operator()(pointer) is called for the removed elements.Throws: Nothing.Complexity: Linear to the number of elements of the list.Note: Invalidates the iterators to the erased elements. voidreferenceRequires: value must be an lvalue.Effects: Inserts the value in the front of the list. No copy constructors are called.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. voidreferenceRequires: value must be an lvalue.Effects: Inserts the value in the back of the list. No copy constructors are called.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. This function is only available is cache_last<> is true. voidEffects: Erases the first element of the list. No destructors are called.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators (but not the references) to the erased element. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the first element of the list. Disposer::operator()(pointer) is called for the removed element.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators to the erased element. referenceEffects: Returns a reference to the first element of the list.Throws: Nothing.Complexity: Constant. const_referenceEffects: Returns a const_reference to the first element of the list.Throws: Nothing.Complexity: Constant. referenceEffects: Returns a reference to the last element of the list.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. This function is only available is cache_last<> is true. const_referenceEffects: Returns a const_reference to the last element of the list.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. This function is only available is cache_last<> is true. iteratorEffects: Returns an iterator to the first element contained in the list.Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns a const_iterator to the first element contained in the list.Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns a const_iterator to the first element contained in the list.Throws: Nothing.Complexity: Constant. iteratorEffects: Returns an iterator to the end of the list.Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns a const_iterator to the end of the list.Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns a const_iterator to the end of the list.Throws: Nothing.Complexity: Constant. iteratorEffects: Returns an iterator that points to a position before the first element. Equivalent to "end()"Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns an iterator that points to a position before the first element. Equivalent to "end()"Throws: Nothing.Complexity: Constant. const_iteratorEffects: Returns an iterator that points to a position before the first element. Equivalent to "end()"Throws: Nothing.Complexity: Constant. iteratorEffects: Returns an iterator to the last element contained in the list.Throws: Nothing.Complexity: Constant.Note: This function is present only if cached_last<> option is true. const_iteratorEffects: Returns a const_iterator to the last element contained in the list.Throws: Nothing.Complexity: Constant.Note: This function is present only if cached_last<> option is true. const_iteratorEffects: Returns a const_iterator to the last element contained in the list.Throws: Nothing.Complexity: Constant.Note: This function is present only if cached_last<> option is true. size_typeEffects: Returns the number of the elements contained in the list.Throws: Nothing.Complexity: Linear to the number of elements contained in the list. if constant_time_size is false. Constant time otherwise.Note: Does not affect the validity of iterators and references. boolEffects: Returns true if the list contains no elements.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. voidslist &Effects: Swaps the elements of x and *this.Throws: Nothing.Complexity: Linear to the number of elements of both lists. Constant-time if linear<> and/or cache_last<> options are used.Note: Does not affect the validity of iterators and references. voidsize_type1Effects: 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.Throws: Nothing.Complexity: Linear to the number of elements plus the number shifts.Note: Iterators Does not affect the validity of iterators and references. voidsize_type1Effects: 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.Throws: Nothing.Complexity: Linear to the number of elements plus the number shifts.Note: Does not affect the validity of iterators and references. voidconst slist &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws. voidslist &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws. iteratorconst_iteratorreferenceRequires: value must be an lvalue and prev_p must point to an element contained by the list or to end().Effects: Inserts the value after the position pointed by prev_p. No copy constructor is called.Returns: An iterator to the inserted element.Throws: Nothing.Complexity: Constant.Note: Does not affect the validity of iterators and references. voidconst_iteratorIteratorIteratorRequires: 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.Effects: Inserts the [f, l) after the position prev_p.Throws: Nothing.Complexity: Linear to the number of elements inserted.Note: Does not affect the validity of iterators and references. iteratorconst_iteratorreferenceRequires: value must be an lvalue and p must point to an element contained by the list or to end().Effects: Inserts the value before the position pointed by p. No copy constructor is called.Throws: Nothing.Complexity: Linear to the number of elements before p. Constant-time if cache_last<> is true and p == end().Note: Does not affect the validity of iterators and references. voidconst_iteratorIteratorIteratorRequires: 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.Effects: Inserts the pointed by b and e before the position p. No copy constructors are called.Throws: Nothing.Complexity: 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<> option is true and p == end().Note: Does not affect the validity of iterators and references. iteratorconst_iteratorEffects: Erases the element after the element pointed by prev of the list. No destructors are called.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators (but not the references) to the erased element. iteratorconst_iteratorconst_iteratorEffects: Erases the range (before_f, l) from the list. No destructors are called.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: 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.Note: Invalidates the iterators (but not the references) to the erased element. iteratorconst_iteratorconst_iteratorsize_typeEffects: Erases the range (before_f, l) from the list. n must be distance(before_f, l) - 1. No destructors are called.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: constant-time if link_mode is normal_link. Linear to the elements (l - before_f) otherwise.Note: Invalidates the iterators (but not the references) to the erased element. iteratorconst_iteratorEffects: Erases the element pointed by i of the list. No destructors are called.Returns: the first element remaining beyond the removed element, or end() if no such element exists.Throws: Nothing.Complexity: Linear to the elements before i.Note: Invalidates the iterators (but not the references) to the erased element. iteratorconst_iteratorconst_iteratorRequires: f and l must be valid iterator to elements in *this.Effects: Erases the range pointed by b and e. No destructors are called.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: Linear to the elements before l.Note: Invalidates the iterators (but not the references) to the erased elements. iteratorconst_iteratorconst_iteratorsize_typeEffects: Erases the range [f, l) from the list. n must be distance(f, l). No destructors are called.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: linear to the elements before f if link_mode is normal_link and constant_time_size is activated. Linear to the elements before l otherwise.Note: Invalidates the iterators (but not the references) to the erased element. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element after the element pointed by prev of the list. Disposer::operator()(pointer) is called for the removed element.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: Constant.Note: Invalidates the iterators to the erased element. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range (before_f, l) from the list. Disposer::operator()(pointer) is called for the removed elements.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: Linear to the elements (l - before_f + 1).Note: Invalidates the iterators to the erased element. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed by i of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.Returns: the first element remaining beyond the removed element, or end() if no such element exists.Throws: Nothing.Complexity: Linear to the elements before i.Note: Invalidates the iterators (but not the references) to the erased element. iteratorconst_iteratorconst_iteratorDisposerRequires: f and l must be valid iterator to elements in *this. Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed by b and e. No destructors are called. Disposer::operator()(pointer) is called for the removed elements.Returns: the first element remaining beyond the removed elements, or end() if no such element exists.Throws: Nothing.Complexity: Linear to the number of erased elements plus linear to the elements before f.Note: Invalidates the iterators (but not the references) to the erased elements. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called.Throws: Nothing.Complexity: 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.Note: Invalidates the iterators (but not the references) to the erased elements. voidDisposerIteratorIteratorRequires: Disposer::operator()(pointer) shouldn't throw.Requires: Dereferencing iterator must yield an lvalue of type value_type.Effects: 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.Throws: Nothing.Complexity: Linear to the number of elements inserted plus linear to the elements contained in the list.Note: Invalidates the iterators (but not the references) to the erased elements. voidconst_iteratorslist &const_iterator *0Requires: prev must point to an element contained by this list or to the before_begin() elementEffects: Transfers all the elements of list x to this list, after the the element pointed by prev. No destructors or copy constructors are called.Returns: Nothing.Throws: Nothing.Complexity: In general, linear to the elements contained in x. Constant-time if cache_last<> option is true and also constant-time if linear<> option is true "this" is empty and "l" is not used.Note: 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.Additional note: 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. voidconst_iteratorslist &const_iteratorRequires: 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().Effects: 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.Throws: Nothing.Complexity: Constant.Note: 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. voidconst_iteratorslist &const_iteratorconst_iteratorRequires: 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() && before_l != x.end().Effects: 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.Throws: Nothing.Complexity: Linear to the number of elements transferred if constant_time_size is true. Constant-time otherwise.Note: 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. voidconst_iteratorslist &const_iteratorconst_iteratorsize_typeRequires: 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() && before_l != x.end() and n == distance(before_f, before_l).Effects: 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.Throws: Nothing.Complexity: Constant time.Note: 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. voidconst_iteratorslist &const_iterator *0Requires: it is an iterator to an element in *this.Effects: Transfers all the elements of list x to this list, before the the element pointed by it. No destructors or copy constructors are called.Returns: Nothing.Throws: Nothing.Complexity: Linear to the elements contained in x plus linear to the elements before it. Linear to the elements before it if cache_last<> option is true. Constant-time if cache_last<> option is true and it == end().Note: 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.Additional note: 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. voidconst_iteratorslist &const_iteratorRequires: it p must be a valid iterator of *this. elem must point to an element contained in list x.Effects: Transfers the element elem, from list x to this list, before the element pointed by pos. No destructors or copy constructors are called.Throws: Nothing.Complexity: Linear to the elements before pos and before elem. Linear to the elements before elem if cache_last<> option is true and pos == end().Note: 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. voidconst_iteratorslist &const_iteratorconst_iteratorRequires: pos must be a dereferenceable iterator in *this and f and f belong to x and f and f a valid range on x.Effects: Transfers the range [f, l) from list x to this list, before the element pointed by pos. No destructors or copy constructors are called.Throws: Nothing.Complexity: Linear to the sum of elements before pos, f, and l plus linear to the number of elements transferred if constant_time_size is true. Linear to the sum of elements before f, and l plus linear to the number of elements transferred if constant_time_size is true if cache_last<> is true and pos == end()Note: 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. voidconst_iteratorslist &const_iteratorconst_iteratorsize_typeRequires: 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).Effects: Transfers the range [f, l) from list x to this list, before the element pointed by pos. No destructors or copy constructors are called.Throws: Nothing.Complexity: Linear to the sum of elements before pos, f, and l. Linear to the sum of elements before f and l if cache_last<> is true and pos == end().Note: 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. voidPredicateEffects: This function sorts the list *this according to std::less<value_type>. The sort is stable, that is, the relative order of equivalent elements is preserved.Throws: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the predicate throws. Basic guarantee.Complexity: The number of comparisons is approximately N log N, where N is the list's size.Note: Iterators and references are not invalidated voidRequires: 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.Effects: 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.Throws: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or std::less<value_type> throws. Basic guarantee.Complexity: This function is linear time: it performs at most size() + x.size() - 1 comparisons.Note: Iterators and references are not invalidated. voidslist &Predicateconst_iterator *0Requires: 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.Effects: 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.Returns: Nothing.Throws: If the predicate throws. Basic guarantee.Complexity: This function is linear time: it performs at most size() + x.size() - 1 comparisons.Note: Iterators and references are not invalidated.Additional note: If optional "l" argument is passed, it is assigned to an iterator to the last transferred value or end() is x is empty. voidslist &Effects: This function removes all of x's elements and inserts them in order into *this according to std::less<value_type>. 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.Throws: if std::less<value_type> throws. Basic guarantee.Complexity: This function is linear time: it performs at most size() + x.size() - 1 comparisons.Note: Iterators and references are not invalidated voidEffects: Reverses the order of elements in the list.Throws: Nothing.Complexity: This function is linear to the contained elements.Note: Iterators and references are not invalidated voidconst_referenceEffects: Removes all the elements that compare equal to value. No destructors are called.Throws: If std::equal_to<value_type> throws. Basic guarantee.Complexity: Linear time. It performs exactly size() comparisons for equality.Note: 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. voidconst_referenceDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Removes all the elements that compare equal to value. Disposer::operator()(pointer) is called for every removed element.Throws: If std::equal_to<value_type> throws. Basic guarantee.Complexity: Linear time. It performs exactly size() comparisons for equality.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidPredEffects: Removes all the elements for which a specified predicate is satisfied. No destructors are called.Throws: If pred throws. Basic guarantee.Complexity: Linear time. It performs exactly size() calls to the predicate.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidPredDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Removes all the elements for which a specified predicate is satisfied. Disposer::operator()(pointer) is called for every removed element.Throws: If pred throws. Basic guarantee.Complexity: Linear time. It performs exactly size() comparisons for equality.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidEffects: Removes adjacent duplicate elements or adjacent elements that are equal from the list. No destructors are called.Throws: If std::equal_to<value_type> throws. Basic guarantee.Complexity: Linear time (size()-1) comparisons calls to pred()).Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidBinaryPredicateEffects: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. No destructors are called.Throws: If the predicate throws. Basic guarantee.Complexity: Linear time (size()-1) comparisons equality comparisons.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. Disposer::operator()(pointer) is called for every removed element.Throws: If std::equal_to<value_type> throws. Basic guarantee.Complexity: Linear time (size()-1) comparisons equality comparisons.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. voidBinaryPredicateDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. Disposer::operator()(pointer) is called for every removed element.Throws: If the predicate throws. Basic guarantee.Complexity: Linear time (size()-1) comparisons equality comparisons.Note: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. iteratorreferenceRequires: value must be a reference to a value inserted in a list.Effects: This function returns a const_iterator pointing to the elementThrows: Nothing.Complexity: Constant time.Note: Iterators and references are not invalidated. const_iteratorconst_referenceRequires: value must be a const reference to a value inserted in a list.Effects: This function returns an iterator pointing to the element.Throws: Nothing.Complexity: Constant time.Note: Iterators and references are not invalidated. iteratoriteratorReturns: 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.Throws: Nothing.Complexity: Linear to the number of elements before i. Constant if cache_last<> is true and i == end(). const_iteratorconst_iteratorReturns: 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.Throws: Nothing.Complexity: Linear to the number of elements before i. Constant if cache_last<> is true and i == end(). iteratorconst_iteratoriteratorReturns: 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.Throws: Nothing.Complexity: Linear to the number of elements before i. Constant if cache_last<> is true and i == end(). const_iteratorconst_iteratorconst_iteratorReturns: 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.Throws: Nothing.Complexity: Linear to the number of elements before i. Constant if cache_last<> is true and i == end(). voidEffects: Asserts the integrity of the container.Complexity: Linear time.Note: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. Effects: constructs an empty list.Complexity: ConstantThrows: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). const value_traits &Effects: constructs an empty list.Complexity: ConstantThrows: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). IteratorIteratorconst value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Constructs a list equal to [b ,e).Complexity: Linear in distance(b, e). No copy constructors are called.Throws: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). slist &&Effects: 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.Complexity: Constant.Throws: 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. slist &slist &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are set to their default value.Complexity: Linear to the number of elements in the list, if it's a safe-mode or auto-unlink value. Otherwise constant. slist &iteratorPrecondition: end_iterator must be a valid end iterator of slist.Effects: Returns a const reference to the slist associated to the end iteratorThrows: Nothing.Complexity: Constant. const slist &const_iteratorPrecondition: end_iterator must be a valid end const_iterator of slist.Effects: Returns a const reference to the slist associated to the end iteratorThrows: Nothing.Complexity: Constant. iteratorreferenceRequires: value must be a reference to a value inserted in a list.Effects: This function returns a const_iterator pointing to the elementThrows: Nothing.Complexity: Constant time.Note: Iterators and references are not invalidated. This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be a const reference to a value inserted in a list.Effects: This function returns an iterator pointing to the element.Throws: Nothing.Complexity: Constant time.Note: Iterators and references are not invalidated. This static function is available only if the value traits is stateless. voidnode_ptrslist &node_ptrnode_ptr voidnode_ptrnode_ptrnode_ptr voidunspecified voidunspecified voidsize_typeunspecified voidsize_typeunspecified voidsize_typeunspecified voidsize_typeunspecified voidslist *slist * voidnode_ptrnode_ptrunspecified voidnode_ptrnode_ptrunspecified slist &const const_iterator &
Helper metafunction to define a slist_base_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a slist_member_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined make_slist_base_hook::type< O1, O2, O3 >Derive a class from slist_base_hook in order to store objects in in an list. slist_base_hook holds the data necessary to maintain the list and provides an appropriate value_traits class for list.The hook admits the following options: tag<>, void_pointer<> and link_mode<>.tag<> 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 list_base_hook, then each list_base_hook needs its unique tag.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook. voidslist_base_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether slist::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const slist_base_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. slist_base_hook &const slist_base_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in an slist an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing. make_slist_member_hook::type< O1, O2, O3 >Put a public data member slist_member_hook in order to store objects of this class in an list. slist_member_hook holds the data necessary for maintaining the list and provides an appropriate value_traits class for list.The hook admits the following options: void_pointer<> and link_mode<>.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook. voidslist_member_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether slist::iterator_to will return a valid iterator.Note: If this member is called when the value is inserted in a slist with the option linear<true>, 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.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const slist_member_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. slist_member_hook &const slist_member_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in an slist an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing.
Helper metafunction to define a splay_multiset that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a splay_set that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined The class template splay_multiset is an intrusive container, that mimics most of the interface of std::multiset as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidsplay_multiset &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst splay_multiset &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. voidsplay_multiset &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. Additional note: non-const function, splaying is performed. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. Additional note: const function, no splaying is performed iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: const function, no splaying is performed iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: const function, no splaying is performed std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. Additional note: const function, no splaying is performed std::pair< iterator, iterator >const_referenceconst_referenceboolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const_referenceconst_referenceboolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voiditeratorRequires: i must be a valid iterator of *this.Effects: Rearranges the container so that the element pointed by i is placed as the root of the tree, improving future searches of this value.Complexity: Amortized logarithmic.Throws: Nothing. iteratorconst KeyType &KeyTypeKeyCompareEffects: 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.Complexity: Amortized logarithmic.Returns: An iterator to the new root of the tree, end() if the tree is empty.Throws: If the comparison functor throws. iteratorconst key_type &Effects: 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.Complexity: Amortized logarithmic.Returns: An iterator to the new root of the tree, end() if the tree is empty.Throws: If the predicate throws. voidEffects: Rebalances the tree.Throws: Nothing.Complexity: Linear. iteratoriteratorRequires: old_root is a node of a tree.Effects: Rebalances the subtree rooted at old_root.Returns: The new root of the subtree.Throws: Nothing.Complexity: Linear to the elements in the subtree. voidsplay_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidsplay_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. splay_multiset &&Effects: 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.Complexity: Constant.Throws: 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. splay_multiset &splay_multiset &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. splay_multiset &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const splay_multiset &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. splay_multiset &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const splay_multiset &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. The class template splay_set is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::value_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidsplay_set &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst splay_set &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. voidsplay_set &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. Additional note: const function, no splaying is performed size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. Additional note: const function, no splaying is performed size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. Additional note: const function, no splaying is performed size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. Additional note: const function, no splaying is performed iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: const function, no splaying is performed iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: const function, no splaying is performed std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voiditeratorRequires: i must be a valid iterator of *this.Effects: Rearranges the container so that the element pointed by i is placed as the root of the tree, improving future searches of this value.Complexity: Amortized logarithmic.Throws: Nothing. iteratorconst KeyType &KeyTypeKeyCompareEffects: 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.Complexity: Amortized logarithmic.Returns: An iterator to the new root of the tree, end() if the tree is empty.Throws: If the comparison functor throws. iteratorconst key_type &Effects: 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.Complexity: Amortized logarithmic.Returns: An iterator to the new root of the tree, end() if the tree is empty.Throws: If the predicate throws. voidEffects: Rebalances the tree.Throws: Nothing.Complexity: Linear. iteratoriteratorRequires: old_root is a node of a tree.Effects: Rebalances the subtree rooted at old_root.Returns: The new root of the subtree.Throws: Nothing.Complexity: Linear to the elements in the subtree. voidsplay_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidsplay_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. splay_set &&Effects: 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.Complexity: Constant.Throws: 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. splay_set &splay_set &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. splay_set &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const splay_set &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. splay_set &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const splay_set &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. boolconst splay_set< T, Options... > &const splay_set< T, Options... > & boolconst splay_set< T, Options... > &const splay_set< T, Options... > & boolconst splay_set< T, Options... > &const splay_set< T, Options... > & boolconst splay_set< T, Options... > &const splay_set< T, Options... > & voidsplay_set< T, Options... > &splay_set< T, Options... > & boolconst splay_multiset< T, Options... > &const splay_multiset< T, Options... > & boolconst splay_multiset< T, Options... > &const splay_multiset< T, Options... > & boolconst splay_multiset< T, Options... > &const splay_multiset< T, Options... > & boolconst splay_multiset< T, Options... > &const splay_multiset< T, Options... > & voidsplay_multiset< T, Options... > &splay_multiset< T, Options... > &
Helper metafunction to define a splaytree that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined The class template splaytree is an intrusive splay tree container that is used to construct intrusive splay_set and splay_multiset containers. The no-throw guarantee holds only, if the key_compare object doesn't throw.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<> and compare<>. ValueTraits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms implementation_defined::insert_commit_data const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidsplaytree &Effects: Swaps the contents of two containers.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst splaytree &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. voidsplaytree &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee.Note: This version can modify the source container, useful to implement move semantics. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare ordering function throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const_iteratorconst key_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp ordering function throws. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: Nothing.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: Nothing.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: Nothing.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: Nothing.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: key is a value such that *this 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 *this.Requires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. Additional note: non-const function, splaying is performed. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. Additional note: non-const function, splaying is performed. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. Additional note: const function, no splaying is performed size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. Additional note: const function, no splaying is performed iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: const function, no splaying is performed iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. Additional note: const function, no splaying is performed std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. Additional note: const function, no splaying is performed std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. Additional note: const function, no splaying is performed std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidsplaytree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidsplaytree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voiditeratorRequires: i must be a valid iterator of *this.Effects: Rearranges the container so that the element pointed by i is placed as the root of the tree, improving future searches of this value.Complexity: Amortized logarithmic.Throws: Nothing. iteratorconst KeyType &KeyTypeKeyCompareEffects: 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.Complexity: Amortized logarithmic.Returns: An iterator to the new root of the tree, end() if the tree is empty.Throws: If the comparison functor throws. iteratorconst key_type &Effects: 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.Complexity: Amortized logarithmic.Returns: An iterator to the new root of the tree, end() if the tree is empty.Throws: If the predicate throws. voidEffects: Rebalances the tree.Throws: Nothing.Complexity: Linear. iteratoriteratorRequires: old_root is a node of a tree.Effects: Rebalances the subtree rooted at old_root.Returns: The new root of the subtree.Throws: Nothing.Complexity: Linear to the elements in the subtree. Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const value_traits &value_traits()Effects: Constructs an empty container with given comparison and traits.Complexity: Constant.Throws: 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. boolIteratorIteratorconst key_compare &key_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. splaytree &&Effects: 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.Complexity: Constant.Throws: 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. splaytree &splaytree &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. splaytree &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const splaytree &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. splaytree &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const splaytree &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks.
A splay tree is an implementation of a binary search tree. The tree is self balancing using the splay algorithm as described in"Self-Adjusting Binary Search Trees by Daniel Dominic Sleator and Robert Endre Tarjan AT&T Bell Laboratories, Murray Hill, NJ Journal of the ACM, Vol 32, no 3, July 1985, pp 652-686splaytree_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:Typedefs:node: The type of the node that forms the binary search treenode_ptr: A pointer to a nodeconst_node_ptr: A pointer to a const nodeStatic functions:static node_ptr get_parent(const_node_ptr n);static void set_parent(node_ptr n, node_ptr parent);static node_ptr get_left(const_node_ptr n);static void set_left(node_ptr n, node_ptr left);static node_ptr get_right(const_node_ptr n);static void set_right(node_ptr n, node_ptr right); NodeTraits::node NodeTraits NodeTraits::node_ptr NodeTraits::const_node_ptr This type is the information that will be filled by insert_unique_check bstree_algo::insert_commit_data node_ptrconst const_node_ptr &Requires: 'node' is a node of the tree or a header node.Effects: Returns the header of the tree.Complexity: Logarithmic.Throws: Nothing. node_ptrconst const_node_ptr &Requires: 'header' is the header node of a tree.Effects: Returns the first node of the tree, the header if the tree is empty.Complexity: Constant time.Throws: Nothing. node_ptrconst const_node_ptr &Requires: 'header' is the header node of a tree.Effects: Returns the header of the tree.Complexity: Constant time.Throws: Nothing. voidconst node_ptr &const node_ptr &Requires: header1 and header2 must be the header nodes of two trees.Effects: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.Complexity: Constant.Throws: Nothing. voidnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees.Effects: 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.Complexity: Logarithmic.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees with header header1 and header2.Effects: 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.Complexity: Constant.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Logarithmic.Throws: Nothing.Note: 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 voidnode_ptrnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Constant.Throws: Nothing.Note: 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 voidnode_ptrRequires: node is a tree node but not the header.Effects: Unlinks the node and rebalances the tree.Complexity: Average complexity is constant time.Throws: Nothing. node_ptrnode_ptrRequires: header is the header of a tree.Effects: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. boolconst_node_ptrRequires: 'node' is a node of the tree or a node initialized by init(...) or init_node.Effects: Returns true if the node is initialized by init() or init_node().Complexity: Constant time.Throws: Nothing. std::size_tconst_node_ptrRequires: node is a node of the tree but it's not the header.Effects: Returns the number of nodes of the subtree.Complexity: Linear time.Throws: Nothing. node_ptrnode_ptrRequires: 'node' is a node from the tree except the header.Effects: Returns the next node of the tree.Complexity: Average constant time.Throws: Nothing. node_ptrnode_ptrRequires: 'node' is a node from the tree except the leftmost node.Effects: Returns the previous node of the tree.Complexity: Average constant time.Throws: Nothing. voidnode_ptrRequires: 'node' must not be part of any tree.Effects: After the function unique(node) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. voidnode_ptrRequires: node must not be part of any tree.Effects: Initializes the header to represent an empty tree. unique(header) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. voidnode_ptrnode_ptrRequires: header must be the header of a tree, z a node of that tree and z != header.Effects: Erases node "z" from the tree with header "header".Complexity: Amortized constant time.Throws: Nothing. Additional notes: the previous node of z is splayed to speed up range deletions. boolnode_ptrNodePtrComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.Returns: True if the node was trasferred, false otherwise.Complexity: Logarithmic.Throws: If the comparison throws. voidnode_ptrNodePtrComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2.Complexity: Logarithmic.Throws: If the comparison throws. voidconst_node_ptrnode_ptrClonerDisposerRequires: "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.Effects: First empties target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Then, duplicates the entire tree pointed by "source_header" cloning each source node with node_ptr Cloner::operator()(const node_ptr &) to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using void disposer(const node_ptr &).Complexity: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. voidnode_ptrDisposerRequires: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.Effects: Empties the target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Complexity: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. std::size_tnode_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns the number of elements with a key equivalent to "key" according to "comp".Complexity: Logarithmic.Throws: If "comp" throws. Additional notes: an element with key key is splayed. std::size_tconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns the number of elements with a key equivalent to "key" according to "comp".Complexity: Logarithmic.Throws: If "comp" throws. Additional note: no splaying is performed node_ptrnode_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. Additional notes: the first node of the range is splayed. node_ptrconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. Additional note: no splaying is performed node_ptrnode_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. Additional notes: the first node of the range is splayed. node_ptrconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. Additional note: no splaying is performed node_ptrnode_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. Additional notes: the found node of the lower bound is splayed. node_ptrconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. Additional note: no splaying is performed std::pair< node_ptr, node_ptr >node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. Additional notes: the first node of the range is splayed. std::pair< node_ptr, node_ptr >const_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. Additional note: no splaying is performed std::pair< node_ptr, node_ptr >node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. Additional notes: the first node of the range is splayed. std::pair< node_ptr, node_ptr >const_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. Additional note: no splaying is performed std::pair< node_ptr, node_ptr >node_ptrconst KeyType &const KeyType &KeyNodePtrCompareboolboolRequires: "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.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If "comp" throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change. Additional notes: the first node of the range is splayed. std::pair< node_ptr, node_ptr >const_node_ptrconst KeyType &const KeyType &KeyNodePtrCompareboolboolRequires: "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.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If "comp" throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change. Additional note: no splaying is performed node_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: Inserts new_node into the tree before the upper bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. Additional note: the inserted node is splayed node_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: Inserts new_node into the tree before the lower bound according to "comp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. Additional note: the inserted node is splayed node_ptrnode_ptrnode_ptrnode_ptrNodePtrCompareRequires: "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.Effects: 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).Complexity: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".Throws: If "comp" throws. Additional note: the inserted node is splayed node_ptrnode_ptrnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. Additional note: the inserted node is splayed voidnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: 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 voidnode_ptrnode_ptrRequires: "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.Effects: Inserts new_node into the tree before "pos".Complexity: Constant-time.Throws: Nothing.Note: 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 std::pair< node_ptr, bool >node_ptrconst KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If "comp" throws.Notes: 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.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))."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 std::pair< node_ptr, bool >node_ptrnode_ptrconst KeyType &KeyNodePtrCompareinsert_commit_data &Requires: "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.Effects: 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).Returns: 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.Complexity: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".Throws: If "comp" throws.Notes: 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.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))."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 voidnode_ptrnode_ptrconst insert_commit_data &Requires: "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".Effects: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.Complexity: Constant time.Throws: Nothing.Notes: 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. boolconst_node_ptrRequires: p is a node of a tree.Effects: Returns true if p is the header of the tree.Complexity: Constant.Throws: Nothing. voidnode_ptrRequires: header must be the header of a tree.Effects: Rebalances the tree.Throws: Nothing.Complexity: Linear. node_ptrnode_ptrRequires: old_root is a node of a tree. It shall not be null.Effects: Rebalances the subtree rooted at old_root.Returns: The new root of the subtree.Throws: Nothing.Complexity: Linear. voidnode_ptrnode_ptr node_ptrnode_ptrconst KeyType &KeyNodePtrComparebool *0
Helper metafunction to define a treap that yields to the same type when the same options (either explicitly or implicitly) are used. pack_options< treap_defaults, O1, O2, O3, O4, O5, O6, O7 >::type unspecified treap< 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 > implementation_defined 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.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<>, compare<>, priority<> and priority_of_value<> ValueTraits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined implementation_defined implementation_defined implementation_defined unspecified node_algorithms::insert_commit_data const bool const bool const bool unspecifiedPrioPrioComp iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the highest priority object of the treap.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the highest priority object of the treap..Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the highest priority object of the treap..Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. priority_compareEffects: Returns the priority_compare object used by the container.Complexity: Constant.Throws: If priority_compare copy-constructor throws. voidtreap &Effects: Swaps the contents of two treaps.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst treap &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidtreap &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &const priority_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comparison or predicate functions throw. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst key_type &const priority_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comparison or predicate functions throw. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator BOOST_INTRUSIVE_I bool >const KeyType &KeyTypeKeyCompareconst PrioType &PrioValuePrioCompareinsert_commit_data &Requires: 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.Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comp or prio_value_pcomp ordering functions throw. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareconst PrioType &PrioValuePrioCompareinsert_commit_data &Requires: 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.Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comp or prio_value_pcomp ordering functions throw. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the avl_set using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: NothingNotes: 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. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: If the internal priority_compare function throws. Strong guarantee.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: If the internal priority_compare function throws. Strong guarantee.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: If the internal priority_compare function throws. Strong guarantee.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareEffects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: if the internal priority_compare function throws. Equivalent guarantee to while(beg != end) erase(beg++);Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: 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.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: 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.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. voidsgtree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) it !itend voidsgtree< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: Extracts each element in source and insert it into a using the comparison object of *this.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) it !itend voidExtraCheckerEffects: Asserts the integrity of the container with additional checks provided by the user.Complexity: Linear time.Note: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. voidEffects: Asserts the integrity of the container.Complexity: Linear time.Note: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const priority_compare &priority_compare()const value_traits &value_traits()Effects: Constructs an empty container.Complexity: Constant.Throws: 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. boolIteratorIteratorconst key_compare &key_compare()const priority_compare &priority_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. treap &&Effects: 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.Complexity: Constant.Throws: 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. treap &treap &&Effects: Equivalent to swap Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. treap &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const treap &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. treap &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const treap &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks.
treap_algorithms provides basic algorithms to manipulate nodes forming a treap.(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.);(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.treap_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:Typedefs:node: The type of the node that forms the treapnode_ptr: A pointer to a nodeconst_node_ptr: A pointer to a const nodeStatic functions:static node_ptr get_parent(const_node_ptr n);static void set_parent(node_ptr n, node_ptr parent);static node_ptr get_left(const_node_ptr n);static void set_left(node_ptr n, node_ptr left);static node_ptr get_right(const_node_ptr n);static void set_right(node_ptr n, node_ptr right); This type is the information that will be filled by insert_unique_check NodeTraits NodeTraits::node NodeTraits::node_ptr NodeTraits::const_node_ptr node_ptrconst_node_ptrRequires: 'node' is a node of the tree or a header node.Effects: Returns the header of the tree.Complexity: Logarithmic.Throws: Nothing. node_ptrconst_node_ptrRequires: 'header' is the header node of a tree.Effects: Returns the first node of the tree, the header if the tree is empty.Complexity: Constant time.Throws: Nothing. node_ptrconst_node_ptrRequires: 'header' is the header node of a tree.Effects: Returns the header of the tree.Complexity: Constant time.Throws: Nothing. voidnode_ptrnode_ptrRequires: header1 and header2 must be the header nodes of two trees.Effects: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.Complexity: Constant.Throws: Nothing. voidnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees.Effects: 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.Complexity: Logarithmic.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrnode_ptrnode_ptrRequires: node1 and node2 can't be header nodes of two trees with header header1 and header2.Effects: 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.Complexity: Constant.Throws: Nothing.Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.Experimental function voidnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Logarithmic.Throws: Nothing.Note: 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 voidnode_ptrnode_ptrnode_ptrRequires: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalancedComplexity: Constant.Throws: Nothing.Note: 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 voidnode_ptrNodePtrPriorityCompareRequires: node is a tree node but not the header.Effects: Unlinks the node and rebalances the tree.Complexity: Average complexity is constant time.Throws: Nothing. node_ptrnode_ptrRequires: header is the header of a tree.Effects: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. boolconst_node_ptrRequires: 'node' is a node of the tree or a node initialized by init(...) or init_node.Effects: Returns true if the node is initialized by init() or init_node().Complexity: Constant time.Throws: Nothing. std::size_tconst_node_ptrRequires: node is a node of the tree but it's not the header.Effects: Returns the number of nodes of the subtree.Complexity: Linear time.Throws: Nothing. node_ptrnode_ptrRequires: 'node' is a node from the tree except the header.Effects: Returns the next node of the tree.Complexity: Average constant time.Throws: Nothing. node_ptrnode_ptrRequires: 'node' is a node from the tree except the leftmost node.Effects: Returns the previous node of the tree.Complexity: Average constant time.Throws: Nothing. voidnode_ptrRequires: 'node' must not be part of any tree.Effects: After the function unique(node) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. voidnode_ptrRequires: node must not be part of any tree.Effects: Initializes the header to represent an empty tree. unique(header) == true.Complexity: Constant.Throws: Nothing.Nodes: If node is inserted in a tree, this function corrupts the tree. node_ptrnode_ptrnode_ptrNodePtrPriorityCompareRequires: header must be the header of a tree, z a node of that tree and z != header.Effects: Erases node "z" from the tree with header "header".Complexity: Amortized constant time.Throws: Nothing. voidconst_node_ptrnode_ptrClonerDisposerRequires: "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.Effects: First empties target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Then, duplicates the entire tree pointed by "source_header" cloning each source node with node_ptr Cloner::operator()(const node_ptr &) to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using void disposer(const node_ptr &).Complexity: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. voidnode_ptrDisposerRequires: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.Effects: Empties the target tree calling void disposer::operator()(const node_ptr &) for every node of the tree except the header.Complexity: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.Throws: If cloner functor throws. If this happens target nodes are disposed. node_ptrconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. node_ptrconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: 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.Complexity: Logarithmic.Throws: If "comp" throws. std::pair< node_ptr, node_ptr >const_node_ptrconst KeyType &const KeyType &KeyNodePtrCompareboolboolRequires: "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.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If "comp" throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change. std::size_tconst_node_ptrconst KeyType &KeyNodePtrCompareRequires: "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.Effects: Returns the number of elements with a key equivalent to "key" according to "comp".Complexity: Logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrNodePtrCompareNodePtrPriorityCompareRequires: "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.Effects: Inserts new_node into the tree before the upper bound according to "comp" and rotates the tree according to "pcomp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throw or "pcomp" throw. node_ptrnode_ptrnode_ptrNodePtrCompareNodePtrPriorityCompareRequires: "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.Effects: Inserts new_node into the tree before the upper bound according to "comp" and rotates the tree according to "pcomp".Complexity: Average complexity for insert element is at most logarithmic.Throws: If "comp" throws. node_ptrnode_ptrnode_ptrnode_ptrNodePtrCompareNodePtrPriorityCompareRequires: "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.Effects: 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".Complexity: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".Throws: If "comp" throw or "pcomp" throw. node_ptrnode_ptrnode_ptrnode_ptrNodePtrPriorityCompareRequires: "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.Effects: Inserts new_node into the tree before "pos" and rotates the tree according to "pcomp".Complexity: Constant-time.Throws: If "pcomp" throws, strong guarantee.Note: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. voidnode_ptrnode_ptrNodePtrPriorityCompareRequires: "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.Effects: Inserts x into the tree in the last position and rotates the tree according to "pcomp".Complexity: Constant-time.Throws: If "pcomp" throws, strong guarantee.Note: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". voidnode_ptrnode_ptrNodePtrPriorityCompareRequires: "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.Effects: Inserts x into the tree in the first position and rotates the tree according to "pcomp".Complexity: Constant-time.Throws: If "pcomp" throws, strong guarantee.Note: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". std::pair< node_ptr, bool >const_node_ptrconst KeyType &KeyNodePtrCompareconst PrioType &PrioNodePtrPrioCompareinsert_commit_data &Requires: "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.Effects: 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.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. std::pair< node_ptr, bool >const_node_ptrnode_ptrconst KeyType &KeyNodePtrCompareconst PrioType &PrioNodePtrPrioCompareinsert_commit_data &Requires: "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.Effects: 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).Returns: 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.Complexity: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".Throws: If "comp" throws.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. voidnode_ptrnode_ptrconst insert_commit_data &Requires: "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".Effects: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.Complexity: Constant time.Throws: Nothing.Notes: 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. boolnode_ptrNodePtrComparePrioNodePtrPrioComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.Returns: True if the node was trasferred, false otherwise.Complexity: Logarithmic.Throws: If the comparison throws. voidnode_ptrNodePtrComparePrioNodePtrPrioComparenode_ptrnode_ptrRequires: 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..Effects: Transfers node "z" from tree1 to tree2.Complexity: Logarithmic.Throws: If the comparison throws. boolconst_node_ptrRequires: p is a node of a tree.Effects: Returns true if p is the header of the tree.Complexity: Constant.Throws: Nothing.
Helper metafunction to define a treap_multiset that yields to the same type when the same options (either explicitly or implicitly) are used. pack_options< treap_defaults, O1, O2, O3, O4, O5, O6, O7 >::type unspecified treap_multiset< 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 > implementation_defined Helper metafunction to define a treap_set that yields to the same type when the same options (either explicitly or implicitly) are used. pack_options< treap_defaults, O1, O2, O3, O4, O5, O6, O7 >::type unspecified treap_set< 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 > implementation_defined The class template treap_multiset is an intrusive container, that mimics most of the interface of std::treap_multiset as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<>, compare<>, priority<> and priority_of_value<> implementation_defined::value_type implementation_defined::value_traits implementation_defined::key_type implementation_defined::key_of_value implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::priority_type implementation_defined::priority_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidtreap_multiset &Effects: Swaps the contents of two treaps.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst treap_multiset &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidtreap_multiset &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. iteratorEffects: Returns an iterator pointing to the highest priority object of the treap.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the highest priority object of the treap..Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the highest priority object of the treap..Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.Complexity: Constant.Throws: Nothing. priority_compareEffects: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.Complexity: Constant.Throws: Nothing. iteratorreferenceRequires: value must be an lvalueEffects: Inserts value into the container before the upper bound.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iterator.Effects: 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)Complexity: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Inserts a each element of a range into the container before the upper bound of the key of each element.Complexity: 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().Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: If the internal priority_compare function throws. Strong guarantee.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: If the internal priority_compare function throws. Strong guarantee.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: If the internal priority_compare function throws. Strong guarantee.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareEffects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: if the internal priority_compare function throws. Equivalent guarantee to while(beg != end) erase(beg++);Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: 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.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: 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.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidtreap_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidtreap_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const priority_compare &priority_compare()const value_traits &value_traits()Effects: Constructs an empty container.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const priority_compare &priority_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. treap_multiset &&Effects: to-do treap_multiset &treap_multiset &&Effects: to-do Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. treap_multiset &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const treap_multiset &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. treap_multiset &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const treap_multiset &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. The class template treap_set is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.The template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<>, compare<>, priority<> and priority_of_value<> implementation_defined::value_type implementation_defined::value_traits implementation_defined::key_type implementation_defined::key_of_value implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::value_compare implementation_defined::key_compare implementation_defined::priority_type implementation_defined::priority_compare implementation_defined::iterator implementation_defined::const_iterator implementation_defined::reverse_iterator implementation_defined::const_reverse_iterator implementation_defined::insert_commit_data implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms const bool iteratorEffects: Returns an iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the beginning of the reversed container.Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the end of the reversed container.Complexity: Constant.Throws: Nothing. iteratorEffects: Returns a iterator pointing to the root node of the container or end() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the root node of the container or cend() if not present.Complexity: Constant.Throws: Nothing. key_compareEffects: Returns the key_compare object used by the container.Complexity: Constant.Throws: If key_compare copy-constructor throws. value_compareEffects: Returns the value_compare object used by the container.Complexity: Constant.Throws: If value_compare copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the container.Complexity: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.Throws: Nothing. voidtreap_set &Effects: Swaps the contents of two treaps.Complexity: Constant.Throws: If the comparison functor's swap call throws. voidconst treap_set &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. voidtreap_set &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.Effects: 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.If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner throws or predicate copy assignment throws. Basic guarantee. iteratorEffects: Returns an iterator pointing to the highest priority object of the treap.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the highest priority object of the treap..Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the highest priority object of the treap..Complexity: Constant.Throws: Nothing. reverse_iteratorEffects: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.Complexity: Constant.Throws: Nothing. const_reverse_iteratorEffects: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.Complexity: Constant.Throws: Nothing. priority_compareEffects: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.Complexity: Constant.Throws: Nothing. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Inserts value into the container if the value is not already present.Complexity: Average complexity for insert element is at most logarithmic.Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorconst_iteratorreferenceRequires: value must be an lvalue, and "hint" must be a valid iteratorEffects: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.Complexity: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &const priority_type &insert_commit_data &Effects: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.Returns: 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.Complexity: Average complexity is at most logarithmic.Throws: If the comparison or predicate functions throw. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const_iteratorconst key_type &const priority_type &insert_commit_data &Effects: 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.Returns: 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.Complexity: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.Throws: If the comparison or predicate functions throw. Strong guarantee.Notes: 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.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))."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. std::pair< iterator, bool >const KeyType &KeyTypeKeyCompareconst PrioType &PrioValuePrioCompareinsert_commit_data & std::pair< iterator, bool >const_iteratorconst KeyType &KeyTypeKeyCompareconst PrioType &PrioValuePrioCompareinsert_commit_data & voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Tries to insert each element of a range into the container.Complexity: 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().Throws: If the internal key_compare or priority_compare functions throw. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. iteratorreferenceconst insert_commit_data &Requires: 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".Effects: Inserts the value in the avl_set using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: NothingNotes: 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. iteratorconst_iteratorreferenceRequires: 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 predicateEffects: Inserts x into the container before "pos".Complexity: Constant time.Throws: If the internal priority_compare function throws. Strong guarantee.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no less than the greatest inserted keyEffects: Inserts x into the container in the last position.Complexity: Constant time.Throws: If the internal priority_compare function throws. Strong guarantee.Note: 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. voidreferenceRequires: value must be an lvalue, and it must be no greater than the minimum inserted keyEffects: Inserts x into the container in the first position.Complexity: Constant time.Throws: If the internal priority_compare function throws. Strong guarantee.Note: 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. iteratorconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average complexity for erase element is constant time.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareEffects: Erases all the elements with the given key. according to the comparison functor "comp".Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: if the internal priority_compare function throws. Equivalent guarantee to while(beg != end) erase(beg++);Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average complexity for erase element is constant time.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators to the erased elements. iteratorconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.Throws: if the internal priority_compare function throws. Strong guarantee.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: 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.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyTypeKeyCompareDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: O(log(size() + N).Throws: 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.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerEffects: Erases all of the elements calling disposer(p) for each node to be erased. Complexity: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.Throws: If key_compare throws. size_typeconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Returns the number of contained elements with the given keyComplexity: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.Throws: If comp throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareEffects: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into *this.Effects: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. const_iteratorconst key_type &Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If key_compare throws. const_iteratorconst KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: Finds an iterator to the first element whose key is k or end() if that element does not exist.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< iterator, iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< const_iterator, const_iterator >const key_type &Effects: 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.Complexity: Logarithmic.Throws: If key_compare throws. std::pair< const_iterator, const_iterator >const KeyType &KeyTypeKeyCompareRequires: key is a value such that *this 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 *this.Effects: 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.Complexity: Logarithmic.Throws: If comp throws. std::pair< iterator, iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< iterator, iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const key_type &const key_type &boolboolRequires: upper_key shall not precede lower_key according to key_compare. [key_comp()(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwisesecond = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwiseComplexity: Logarithmic.Throws: If key_compare throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.Note: Experimental function, the interface might change in future releases. std::pair< const_iterator, const_iterator >const KeyType &const KeyType &KeyTypeKeyCompareboolboolRequires: lower_key is a value such that *this is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.upper_key is a value such that *this is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.upper_key shall not precede lower_key according to comp [comp(upper_key, lower_key) shall be false]If lower_key is equivalent to upper_key [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.Effects: Returns an a pair with the following criteria:first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwisesecond = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwiseComplexity: Logarithmic.Throws: If comp throws.Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.Note: Experimental function, the interface might change in future releases. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing. pointerEffects: Unlinks the leftmost node from the container.Complexity: Average complexity is constant time.Throws: Nothing.Notes: 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. voiditeratorreferenceRequires: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.Effects: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.Complexity: Constant.Throws: Nothing.Note: 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. voidreferenceEffects: removes "value" from the container.Throws: Nothing.Complexity: Logarithmic time.Note: This static function is only usable with non-constant time size containers that have stateless comparison functors.If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. voidtreap_set< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) voidtreap_multiset< T, Options2... > &Requires: "source" container's Options can only can differ in the comparison function from *this.Effects: 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.Postcondition: 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.Throws: Nothing unless the comparison object throws.Complexity: N log(a.size() + N) (N has the value source.size()) Effects: Constructs an empty container.Complexity: Constant.Throws: 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. const key_compare &const priority_compare &priority_compare()const value_traits &value_traits()Effects: Constructs an empty container.Complexity: Constant.Throws: 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. IteratorIteratorconst key_compare &key_compare()const priority_compare &priority_compare()const value_traits &value_traits()Requires: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: 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.Throws: 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. treap_set &&Effects: to-do treap_set &treap_set &&Effects: to-do Effects: 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 value_traits template parameter are reinitialized and thus can be reused.Complexity: Linear to elements contained in *this.Throws: Nothing. treap_set &iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. const treap_set &const_iteratorPrecondition: end_iterator must be a valid end iterator of the container.Effects: Returns a const reference to the container associated to the end iteratorThrows: Nothing.Complexity: Constant. treap_set &iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. const treap_set &const_iteratorPrecondition: it must be a valid iterator of the container.Effects: Returns a const reference to the container associated to the iteratorThrows: Nothing.Complexity: Logarithmic. iteratorreferenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator i belonging to the set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. voidreferenceRequires: value shall not be in a container.Effects: init_node puts the hook of a value in a well-known default state.Throws: Nothing.Complexity: Constant time.Note: This function puts the hook in the well-known default state used by auto_unlink and safe hooks.
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 NodeTraits node_traits::node_ptr node_traits::const_node_ptr node_traits::node node_ptr const_node_ptr const link_mode_type node_ptrvalue_type & const_node_ptrconst value_type & const pointer &const node_ptr & const const_pointer &const const_node_ptr &
Helper metafunction to define an unordered_multiset that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define an unordered_set that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined boost::intrusive::hashtable< ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags >The class template unordered_multiset is an intrusive container, that mimics most of the interface of std::tr1::unordered_multiset as described in the C++ TR1.unordered_multiset 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: unordered_multiset needs a pointer to an array of type bucket_type to be passed in the constructor. This bucket array must have at least the same lifetime as the container. This makes the use of unordered_multiset more complicated than purely intrusive containers. bucket_type is default-constructible, copyable and assignableThe template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<>, hash<> and equal<> bucket_traits<>, power_2_buckets<> and cache_begin<>.unordered_multiset 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.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.unordered_multiset, 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.Since no automatic rehashing is done, iterators are never invalidated when inserting or erasing elements. Iterators are only invalidated when rehasing. implementation_defined::value_type implementation_defined::key_type implementation_defined::value_traits implementation_defined::bucket_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::key_equal implementation_defined::hasher implementation_defined::bucket_type implementation_defined::bucket_ptr implementation_defined::iterator implementation_defined::const_iterator implementation_defined::insert_commit_data implementation_defined::local_iterator implementation_defined::const_local_iterator implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms iteratorEffects: Returns an iterator pointing to the beginning of the unordered_set.Complexity: Amortized constant time. Worst case (empty unordered_set): O(this->bucket_count())Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the unordered_set.Complexity: Amortized constant time. Worst case (empty unordered_set): O(this->bucket_count())Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the unordered_set.Complexity: Amortized constant time. Worst case (empty unordered_set): O(this->bucket_count())Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the unordered_set.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the unordered_set.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the unordered_set.Complexity: Constant.Throws: Nothing. hasherEffects: Returns the hasher object used by the unordered_set.Complexity: Constant.Throws: If hasher copy-constructor throws. key_equalEffects: Returns the key_equal object used by the unordered_set.Complexity: Constant.Throws: If key_equal copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: if constant-time size and cache_begin options are disabled, average constant time (worst case, with empty() == true: O(this->bucket_count()). Otherwise constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the unordered_set.Complexity: Linear to elements contained in *this if constant_time_size is false. Constant-time otherwise.Throws: Nothing. voidunordered_multiset &Requires: buckets must not be being used by any other resource.Effects: Constructs an empty unordered_set, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.Complexity: Constant.Throws: 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.Notes: buckets array must be disposed only after *this is disposed. voidconst unordered_multiset &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.Effects: 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.If store_hash option is true, this method does not use the hash function.If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. voidunordered_multiset &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.Effects: 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.If store_hash option is true, this method does not use the hash function.If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. iteratorreferenceRequires: value must be an lvalueEffects: Inserts the value into the unordered_set.Returns: An iterator to the inserted value.Complexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Equivalent to this->insert_equal(t) for each element in [b, e).Complexity: Average case O(N), where N is distance(b, e). Worst case O(N*this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average case O(1), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased element. No destructors are called. voidconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average case O(distance(b, e)), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Erases all the elements that have the same hash and compare equal with the given key.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If hash_func or equal_func throw. Basic guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average case O(1), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average case O(distance(b, e)), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyHasherKeyEqualDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "equal_func". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If hash_func or equal_func throw. Basic guarantee.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all of the elements.Complexity: Linear to the number of elements on the container. Disposer::operator()(pointer) is called for the removed elements.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. size_typeconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Returns the number of contained elements with the given keyComplexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal throw. iteratorconst key_type &Effects: Finds an iterator to the first element is equal to "value" or end() if that element does not exist.Complexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. iteratorconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal_func throw.Note: 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. const_iteratorconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. const_iteratorconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal_func throw.Note: 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. std::pair< iterator, iterator >const key_type &Effects: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. std::pair< iterator, iterator >const KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(key, hash_func, equal_func)). Worst case O(this->size()).Throws: If hash_func or the equal_func throw.Note: 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. std::pair< const_iterator, const_iterator >const key_type &Effects: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. std::pair< const_iterator, const_iterator >const KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(key, hash_func, equal_func)). Worst case O(this->size()).Throws: If the hasher or equal_func throw.Note: 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. iteratorreferenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: If the internal hash function throws. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: If the internal hash function throws. local_iteratorreferenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing. const_local_iteratorconst_referenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of buckets passed in the constructor or the last rehash function.Complexity: Constant.Throws: Nothing. size_typesize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns the number of elements in the nth bucket.Complexity: Constant.Throws: Nothing. size_typeconst key_type &Effects: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.Complexity: Constant.Throws: If the hash functor throws.Note: the return value is in the range [0, this->bucket_count()). size_typeconst KeyType &KeyHasherRequires: "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.Effects: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.Complexity: Constant.Throws: If hash_func throws.Note: the return value is in the range [0, this->bucket_count()). bucket_ptrEffects: Returns the bucket array pointer passed in the constructor or the last rehash function.Complexity: Constant.Throws: Nothing. local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a local_iterator pointing to the beginning of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a local_iterator pointing to the end of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. voidconst bucket_traits &Requires: 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->bucket_pointer() new_bucket_traits.bucket_count() can be bigger or smaller than this->bucket_count(). 'new_bucket_traits' copy constructor should not throw.Effects: If new_bucket_traits.bucket_begin() == this->bucket_pointer() is false, unlinks values from the old bucket and inserts then in the new one according to the hash value of values.If new_bucket_traits.bucket_begin() == this->bucket_pointer() is true, the implementations avoids moving values as much as possible.Bucket traits hold by *this is assigned from new_bucket_traits. If the container is configured as incremental<>, the split bucket is set to the new bucket_count().If store_hash 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<true> is true).If rehash is successful updates the internal bucket_traits with new_bucket_traits.Complexity: Average case linear in this->size(), worst case quadratic.Throws: If the hasher functor throws. Basic guarantee. voidNote: 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.Requires: 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.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.Effects: Reprocesses all values hold by *this, recalculating their hash values and redistributing them though the buckets.If store_hash option is true, this method uses the hash function and updates the stored hash value.Complexity: Average case linear in this->size(), worst case quadratic.Throws: If the hasher functor throws. Basic guarantee. boolbooltrueRequires:Effects:Complexity:Throws:Note: this method is only available if incremental<true> option is activated. boolconst bucket_traits &Effects: If new_bucket_traits.bucket_count() is not this->bucket_count()/2 or this->bucket_count()*2, or this->split_bucket() != new_bucket_traits.bucket_count() returns false and does nothing.Otherwise, copy assigns new_bucket_traits to the internal bucket_traits and transfers all the objects from old buckets to the new ones.Complexity: Linear to size().Throws: NothingNote: this method is only available if incremental<true> option is activated. size_typeRequires: incremental<> option must be setEffects: returns the current split countComplexity: ConstantThrows: Nothing const bucket_traits &const hasher &hasher()const key_equal &key_equal()const value_traits &value_traits()Requires: buckets must not be being used by any other resource.Effects: Constructs an empty unordered_set, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.Complexity: Constant.Throws: 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.Notes: buckets array must be disposed only after *this is disposed. IteratorIteratorconst bucket_traits &const hasher &hasher()const key_equal &key_equal()const value_traits &value_traits()Requires: buckets must not be being used by any other resource and dereferencing iterator must yield an lvalue of type value_type.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: If N is distance(b, e): Average case is O(N) (with a good hash function and with buckets_len >= N),worst case O(N^2).Throws: 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.Notes: buckets array must be disposed only after *this is disposed. unordered_multiset &&Effects: to-do unordered_multiset &unordered_multiset &&Effects: to-do Effects: Detaches all elements from this. The objects in the unordered_set are not deleted (i.e. no destructors are called).Complexity: Linear to the number of elements in the unordered_set, if it's a safe-mode or auto-unlink value. Otherwise constant.Throws: Nothing. local_iteratorreferenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_local_iteratorconst_referenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. size_typesize_typeEffects: 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.Complexity: Amortized constant time.Throws: Nothing. size_typesize_typeEffects: 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.Complexity: Amortized constant time.Throws: Nothing. boost::intrusive::hashtable< ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags|hash_bool_flags::unique_keys_pos >The class template unordered_set is an intrusive container, that mimics most of the interface of std::tr1::unordered_set as described in the C++ TR1.unordered_set 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: unordered_set needs a pointer to an array of type bucket_type to be passed in the constructor. This bucket array must have at least the same lifetime as the container. This makes the use of unordered_set more complicated than purely intrusive containers. bucket_type is default-constructible, copyable and assignableThe template parameter T 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.The container supports the following options: base_hook<>/member_hook<>/value_traits<>, constant_time_size<>, size_type<>, hash<> and equal<> bucket_traits<>, power_2_buckets<> and cache_begin<>.unordered_set 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.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.unordered_set, 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.Since no automatic rehashing is done, iterators are never invalidated when inserting or erasing elements. Iterators are only invalidated when rehasing. implementation_defined::value_type implementation_defined::key_type implementation_defined::key_of_value implementation_defined::value_traits implementation_defined::bucket_traits implementation_defined::pointer implementation_defined::const_pointer implementation_defined::reference implementation_defined::const_reference implementation_defined::difference_type implementation_defined::size_type implementation_defined::key_equal implementation_defined::hasher implementation_defined::bucket_type implementation_defined::bucket_ptr implementation_defined::iterator implementation_defined::const_iterator implementation_defined::insert_commit_data implementation_defined::local_iterator implementation_defined::const_local_iterator implementation_defined::node_traits implementation_defined::node implementation_defined::node_ptr implementation_defined::const_node_ptr implementation_defined::node_algorithms iteratorEffects: Returns an iterator pointing to the beginning of the unordered_set.Complexity: Amortized constant time. Worst case (empty unordered_set): O(this->bucket_count())Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the unordered_set.Complexity: Amortized constant time. Worst case (empty unordered_set): O(this->bucket_count())Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the beginning of the unordered_set.Complexity: Amortized constant time. Worst case (empty unordered_set): O(this->bucket_count())Throws: Nothing. iteratorEffects: Returns an iterator pointing to the end of the unordered_set.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the unordered_set.Complexity: Constant.Throws: Nothing. const_iteratorEffects: Returns a const_iterator pointing to the end of the unordered_set.Complexity: Constant.Throws: Nothing. hasherEffects: Returns the hasher object used by the unordered_set.Complexity: Constant.Throws: If hasher copy-constructor throws. key_equalEffects: Returns the key_equal object used by the unordered_set.Complexity: Constant.Throws: If key_equal copy-constructor throws. boolEffects: Returns true if the container is empty.Complexity: if constant-time size and cache_begin options are disabled, average constant time (worst case, with empty() == true: O(this->bucket_count()). Otherwise constant.Throws: Nothing. size_typeEffects: Returns the number of elements stored in the unordered_set.Complexity: Linear to elements contained in *this if constant_time_size is false. Constant-time otherwise.Throws: Nothing. voidunordered_set &Requires: buckets must not be being used by any other resource.Effects: Constructs an empty unordered_set, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.Complexity: Constant.Throws: 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.Notes: buckets array must be disposed only after *this is disposed. voidconst unordered_set &ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.Effects: 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.If store_hash option is true, this method does not use the hash function.If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. voidunordered_set &&ClonerDisposerRequires: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.Effects: 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.If store_hash option is true, this method does not use the hash function.If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).Complexity: Linear to erased plus inserted elements.Throws: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. std::pair< iterator, bool >referenceRequires: value must be an lvalueEffects: Tries to inserts value into the unordered_set.Returns: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Strong guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. voidIteratorIteratorRequires: Dereferencing iterator must yield an lvalue of type value_type.Effects: Equivalent to this->insert_unique(t) for each element in [b, e).Complexity: Average case O(N), where N is distance(b, e). Worst case O(N*this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Does not affect the validity of iterators and references. No copy-constructors are called. std::pair< iterator, bool >const key_type &insert_commit_data &Effects: Checks if a value can be inserted in the unordered_set, using a user provided key instead of the value itself.Returns: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hasher or key_compare throw. Strong guarantee.Notes: 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.If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the unordered_set.After a successful rehashing insert_commit_data remains valid. std::pair< iterator, bool >const KeyType &KeyHasherKeyEqualinsert_commit_data &Requires: "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."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.Effects: Checks if a value can be inserted in the unordered_set, using a user provided key instead of the value itself.Returns: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal_func throw. Strong guarantee.Notes: 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.If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time."commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the unordered_set.After a successful rehashing insert_commit_data remains valid. iteratorreferenceconst insert_commit_data &Requires: 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 unordered_set between the "insert_check" that filled "commit_data" and the call to "insert_commit".Effects: Inserts the value in the unordered_set using the information obtained from the "commit_data" that a previous "insert_check" filled.Returns: An iterator to the newly inserted object.Complexity: Constant time.Throws: Nothing.Notes: 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.After a successful rehashing insert_commit_data remains valid. voidconst_iteratorEffects: Erases the element pointed to by i.Complexity: Average case O(1), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased element. No destructors are called. voidconst_iteratorconst_iteratorEffects: Erases the range pointed to by b end e.Complexity: Average case O(distance(b, e)), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Erases all the elements with the given value.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Erases all the elements that have the same hash and compare equal with the given key.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If hash_func or equal_func throw. Basic guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.Complexity: Average case O(1), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators to the erased elements. voidconst_iteratorconst_iteratorDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.Complexity: Average case O(distance(b, e)), worst case O(this->size()).Throws: Nothing.Note: Invalidates the iterators to the erased elements. size_typeconst key_type &DisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. Basic guarantee.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst KeyType &KeyHasherKeyEqualDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all the elements with the given key. according to the comparison functor "equal_func". Disposer::operator()(pointer) is called for the removed elements.Returns: The number of erased elements.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If hash_func or equal_func throw. Basic guarantee.Note: Invalidates the iterators to the erased elements. voidEffects: Erases all of the elements.Complexity: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. voidDisposerRequires: Disposer::operator()(pointer) shouldn't throw.Effects: Erases all of the elements.Complexity: Linear to the number of elements on the container. Disposer::operator()(pointer) is called for the removed elements.Throws: Nothing.Note: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. size_typeconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. size_typeconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Returns the number of contained elements with the given keyComplexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal throw. iteratorconst key_type &Effects: Finds an iterator to the first element is equal to "value" or end() if that element does not exist.Complexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. iteratorconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal_func throw.Note: 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. const_iteratorconst key_type &Effects: Returns the number of contained elements with the given valueComplexity: Average case O(1), worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. const_iteratorconst KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: 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.Complexity: Average case O(1), worst case O(this->size()).Throws: If hash_func or equal_func throw.Note: 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. std::pair< iterator, iterator >const key_type &Effects: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. std::pair< iterator, iterator >const KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(key, hash_func, equal_func)). Worst case O(this->size()).Throws: If hash_func or the equal_func throw.Note: 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. std::pair< const_iterator, const_iterator >const key_type &Effects: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(value)). Worst case O(this->size()).Throws: If the internal hasher or the equality functor throws. std::pair< const_iterator, const_iterator >const KeyType &KeyHasherKeyEqualRequires: "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."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.Effects: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this->end(), this->end()) if no such elements exist.Complexity: Average case O(this->count(key, hash_func, equal_func)). Worst case O(this->size()).Throws: If the hasher or equal_func throw.Note: 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. iteratorreferenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: If the internal hash function throws. const_iteratorconst_referenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid const_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: If the internal hash function throws. local_iteratorreferenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing. const_local_iteratorconst_referenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing. size_typeEffects: Returns the number of buckets passed in the constructor or the last rehash function.Complexity: Constant.Throws: Nothing. size_typesize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns the number of elements in the nth bucket.Complexity: Constant.Throws: Nothing. size_typeconst key_type &Effects: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.Complexity: Constant.Throws: If the hash functor throws.Note: the return value is in the range [0, this->bucket_count()). size_typeconst KeyType &KeyHasherRequires: "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.Effects: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.Complexity: Constant.Throws: If hash_func throws.Note: the return value is in the range [0, this->bucket_count()). bucket_ptrEffects: Returns the bucket array pointer passed in the constructor or the last rehash function.Complexity: Constant.Throws: Nothing. local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a local_iterator pointing to the beginning of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a local_iterator pointing to the end of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. const_local_iteratorsize_typeRequires: n is in the range [0, this->bucket_count()).Effects: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.Complexity: Constant.Throws: Nothing.Note: [this->begin(n), this->end(n)) is a valid range containing all of the elements in the nth bucket. voidconst bucket_traits &Requires: 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->bucket_pointer() new_bucket_traits.bucket_count() can be bigger or smaller than this->bucket_count(). 'new_bucket_traits' copy constructor should not throw.Effects: If new_bucket_traits.bucket_begin() == this->bucket_pointer() is false, unlinks values from the old bucket and inserts then in the new one according to the hash value of values.If new_bucket_traits.bucket_begin() == this->bucket_pointer() is true, the implementations avoids moving values as much as possible.Bucket traits hold by *this is assigned from new_bucket_traits. If the container is configured as incremental<>, the split bucket is set to the new bucket_count().If store_hash 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<true> is true).If rehash is successful updates the internal bucket_traits with new_bucket_traits.Complexity: Average case linear in this->size(), worst case quadratic.Throws: If the hasher functor throws. Basic guarantee. voidNote: 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.Requires: 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.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.Effects: Reprocesses all values hold by *this, recalculating their hash values and redistributing them though the buckets.If store_hash option is true, this method uses the hash function and updates the stored hash value.Complexity: Average case linear in this->size(), worst case quadratic.Throws: If the hasher functor throws. Basic guarantee. boolbooltrueRequires:Effects:Complexity:Throws:Note: this method is only available if incremental<true> option is activated. boolconst bucket_traits &Effects: If new_bucket_traits.bucket_count() is not this->bucket_count()/2 or this->bucket_count()*2, or this->split_bucket() != new_bucket_traits.bucket_count() returns false and does nothing.Otherwise, copy assigns new_bucket_traits to the internal bucket_traits and transfers all the objects from old buckets to the new ones.Complexity: Linear to size().Throws: NothingNote: this method is only available if incremental<true> option is activated. size_typeRequires: incremental<> option must be setEffects: returns the current split countComplexity: ConstantThrows: Nothing const bucket_traits &const hasher &hasher()const key_equal &key_equal()const value_traits &value_traits()Requires: buckets must not be being used by any other resource.Effects: Constructs an empty unordered_set, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.Complexity: Constant.Throws: 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.Notes: buckets array must be disposed only after *this is disposed. IteratorIteratorconst bucket_traits &const hasher &hasher()const key_equal &key_equal()const value_traits &value_traits()Requires: buckets must not be being used by any other resource and dereferencing iterator must yield an lvalue of type value_type.Effects: Constructs an empty container and inserts elements from [b, e).Complexity: If N is distance(b, e): Average case is O(N) (with a good hash function and with buckets_len >= N),worst case O(N^2).Throws: 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.Notes: buckets array must be disposed only after *this is disposed. unordered_set &&Effects: 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.Complexity: Constant.Throws: 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. unordered_set &unordered_set &&Effects: Equivalent to swap. Effects: Detaches all elements from this. The objects in the unordered_set are not deleted (i.e. no destructors are called).Complexity: Linear to the number of elements in the unordered_set, if it's a safe-mode or auto-unlink value. Otherwise constant.Throws: Nothing. local_iteratorreferenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. const_local_iteratorconst_referenceRequires: value must be an lvalue and shall be in a unordered_set of appropriate type. Otherwise the behavior is undefined.Effects: Returns: a valid local_iterator belonging to the unordered_set that points to the valueComplexity: Constant.Throws: Nothing.Note: This static function is available only if the value traits is stateless. size_typesize_typeEffects: 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.Complexity: Amortized constant time.Throws: Nothing. size_typesize_typeEffects: 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.Complexity: Amortized constant time.Throws: Nothing.
Helper metafunction to define a unordered_set_base_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined Helper metafunction to define a unordered_set_member_hook that yields to the same type when the same options (either explicitly or implicitly) are used. implementation_defined make_unordered_set_base_hook::type< O1, O2, O3, O4 >Derive a class from unordered_set_base_hook in order to store objects in in an unordered_set/unordered_multi_set. unordered_set_base_hook holds the data necessary to maintain the unordered_set/unordered_multi_set and provides an appropriate value_traits class for unordered_set/unordered_multi_set.The hook admits the following options: tag<>, void_pointer<>, link_mode<>, store_hash<> and optimize_multikey<>.tag<> 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 list_base_hook, then each list_base_hook needs its unique tag.void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).store_hash<> will tell the hook to store the hash of the value to speed up rehashings.optimize_multikey<> 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. voidunordered_set_base_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether unordered_set::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const unordered_set_base_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. unordered_set_base_hook &const unordered_set_base_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in an unordered_set an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing. make_unordered_set_member_hook::type< O1, O2, O3, O4 >Put a public data member unordered_set_member_hook in order to store objects of this class in an unordered_set/unordered_multi_set. unordered_set_member_hook holds the data necessary for maintaining the unordered_set/unordered_multi_set and provides an appropriate value_traits class for unordered_set/unordered_multi_set.The hook admits the following options: void_pointer<>, link_mode<> and store_hash<>.void_pointer<> is the pointer type that will be used internally in the hook and the container configured to use this hook.link_mode<> will specify the linking mode of the hook (normal_link, auto_unlink or safe_link).store_hash<> will tell the hook to store the hash of the value to speed up rehashings. voidunordered_set_member_hook &Effects: 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.Complexity: ConstantThrows: Nothing. boolPrecondition: link_mode must be safe_link or auto_unlink.Returns: true, if the node belongs to a container, false otherwise. This function can be used to test whether unordered_set::iterator_to will return a valid iterator.Complexity: Constant voidEffects: Removes the node if it's inserted in a container. This function is only allowed if link_mode is auto_unlink.Throws: Nothing. Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state.Throws: Nothing. const unordered_set_member_hook &Effects: If link_mode is auto_unlink or safe_link initializes the node to an unlinked state. The argument is ignored.Throws: Nothing.Rationale: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. unordered_set_member_hook &const unordered_set_member_hook &Effects: Empty function. The argument is ignored.Throws: Nothing.Rationale: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. swap can be used to emulate move-semantics. Effects: If link_mode is normal_link, the destructor does nothing (ie. no code is generated). If link_mode is safe_link and the object is stored in an unordered_set an assertion is raised. If link_mode is auto_unlink and is_linked() is true, the node is unlinked.Throws: Nothing.