[equal.range] (original) (raw)

template<class ForwardIterator, class T> constexpr pair<ForwardIterator, ForwardIterator> equal_range(ForwardIterator first, ForwardIterator last, const T& value);template<class ForwardIterator, class T, class Compare> constexpr pair<ForwardIterator, ForwardIterator> equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);template<forward_­iterator I, sentinel_­for<I> S, class T, class Proj = identity,indirect_­strict_­weak_­order<const T*, projected<I, Proj>> Comp = ranges::less> constexpr subrange<I> ranges::equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {});template<forward_­range R, class T, class Proj = identity,indirect_­strict_­weak_­order<const T*, projected<iterator_t<R>, Proj>> Comp = ranges::less> constexpr borrowed_subrange_t<R> ranges::equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {});

Preconditions:The elements e of [first, last)are partitioned with respect to the expressionsbool(invoke(comp, invoke(proj, e), value)) and!bool(invoke(comp, value, invoke(proj, e))).

Also, for all elements e of [first, last),bool(comp(e, value)) implies !bool(comp(​value, e))for the overloads in namespace std.