11 Algorithms library [algorithms]

11.5 Sorting and related operations [alg.sorting]

11.5.3 Binary search [alg.binary.search]

11.5.3.3 equal_range [equal.range]

template <ForwardIterator I, Sentinel<I> S, class T, class Proj = identity, IndirectStrictWeakOrder<const T*, projected<I, Proj>> Comp = less<>> tagged_pair<tag::begin(I), tag::end(I)> equal_range(I first, S last, const T& value, Comp comp = Comp{}, Proj proj = Proj{}); template <ForwardRange Rng, class T, class Proj = identity, IndirectStrictWeakOrder<const T*, projected<iterator_t<Rng>, Proj>> Comp = less<>> tagged_pair<tag::begin(safe_iterator_t<Rng>), tag::end(safe_iterator_t<Rng>)> equal_range(Rng&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{});

Requires: The elements e of [first,last) shall be partitioned with respect to the expressions invoke(comp, invoke(proj, e), value) and !invoke(comp, value, invoke(proj, e)). Also, for all elements e of [first, last), invoke(comp, invoke(proj, e), value) shall imply
!invoke(comp, value, invoke(proj, e)).

Returns:

Complexity: At most 2 * log2(last - first) + Ο(1) applications of the comparison function and projection.