23 Containers library [containers]

23.3 Sequence containers [sequences]

23.3.9 Class template hive [hive]

23.3.9.5 Operations [hive.operations]

In this subclause, arguments for a template parameter named Predicate or BinaryPredicate shall meet the corresponding requirements in [algorithms.requirements].
The semantics of i + n and i - n, where i is an iterator into the hive and n is an integer, are the same as those of next(i, n) and prev(i, n), respectively.
For sort, the definitions and requirements in [alg.sorting] apply.
void splice(hive& x); void splice(hive&& x);
Preconditions: get_allocator() == x.get_allocator() is true.
Effects: If addressof(x) == this is true, the behavior is erroneous and there are no effects.
Otherwise, inserts the contents of x into *this and x becomes empty.
Pointers and references to the moved elements of x now refer to those same elements but as members of *this.
Iterators referring to the moved elements continue to refer to their elements, but they now behave as iterators into *this, not into x.
Throws: length_error if any of x's active blocks are not within the bounds of current-limits.
Complexity: Linear in the sum of all element blocks in x plus all element blocks in *this.
Remarks: Reserved blocks in x are not transferred into *this.
If addressof(x) == this is false, invalidates the past-the-end iterator for both x and *this.
template<class BinaryPredicate = equal_to<T>> size_type unique(BinaryPredicate binary_pred = BinaryPredicate());
Preconditions: binary_pred is an equivalence relation.
Effects: Erases all but the first element from every consecutive group of equivalent elements.
That is, for a nonempty hive, erases all elements referred to by the iterator i in the range [begin() + 1, end()) for which binary_pred(*i, *(i - 1)) is true.
Returns: The number of elements erased.
Throws: Nothing unless an exception is thrown by the predicate.
Complexity: If empty() is false, exactly size() - 1 applications of the corresponding predicate, otherwise no applications of the predicate.
Remarks: Invalidates references, pointers, and iterators referring to the erased elements.
If the last element in *this is erased, also invalidates the past-the-end iterator.
template<class Compare = less<T>> void sort(Compare comp = Compare());
Preconditions: T is Cpp17MoveInsertable into hive, Cpp17MoveAssignable, and Cpp17Swappable.
Effects: Sorts *this according to the comp function object.
If an exception is thrown, the order of the elements in *this is unspecified.
Complexity: comparisons, where N is size().
Remarks: May allocate.
References, pointers, and iterators referring to elements in *this, as well as the past-the-end iterator, may be invalidated.
[Note 1: 
Not required to be stable[algorithm.stable].
— end note]
iterator get_iterator(const_pointer p) noexcept; const_iterator get_iterator(const_pointer p) const noexcept;
Preconditions: p points to an element in *this.
Returns: An iterator or const_iterator pointing to the same element as p.
Complexity: Linear in the number of active blocks in *this.