cpp/algorithm/ranges/equal range

@1@ Returns a view containing all elements equivalent to in the range.

The range must be at least partially ordered with respect to, i.e. it must satisfy all of the following requirements: A fully-sorted range meets these criteria.
 * partitioned with respect to or  (that is, all elements for which the expression is  precedes all elements for which the expression is ).
 * partitioned with respect to or.
 * for all elements, if or  is  then  or  is also.

The returned view is constructed from two iterators, one pointing to the first element that is not less than and another pointing to the first element greater than. The first iterator may be alternatively obtained with std, the second - with std.

@2@ Same as, but uses as the source range, as if using the range  as  and  as.

Return value
std containing a pair of iterators defining the wanted range, the first pointing to the first element that is not less than and the second pointing to the first element greater than.

If there are no elements not less than, the last iterator (iterator that is equal to or ) is returned as the first element. Similarly if there are no elements greater than, the last iterator is returned as the second element.

Complexity
The number of comparisons performed is logarithmic in the distance between and  (at most $2 * log 2(last - first) + O(1)$ comparisons). However, for an iterator that does not model, the number of iterator increments is linear.