17#ifndef RANGES_V3_ALGORITHM_UNIQUE_HPP
18#define RANGES_V3_ALGORITHM_UNIQUE_HPP
31#include <range/v3/utility/static_const.hpp>
33#include <range/v3/detail/prologue.hpp>
39 RANGES_FUNC_BEGIN(unique)
50 template(
typename I,
typename S,
typename C =
equal_to,
typename P =
identity)(
52 constexpr I RANGES_FUNC(unique)(I
first, S last, C pred = C{}, P proj = P{})
54 first = adjacent_find(std::move(first), last, ranges::ref(pred), ranges::ref(proj));
58 for(I i = next(first); ++i != last;)
60 *++
first = iter_move(i);
69 constexpr borrowed_iterator_t<Rng>
70 RANGES_FUNC(unique)(Rng && rng, C pred = C{}, P proj = P{})
72 return (*
this)(begin(rng), end(rng), std::move(pred), std::move(proj));
75 RANGES_FUNC_END(unique)
84#include <range/v3/detail/epilogue.hpp>
The sentinel_for concept.
decltype(begin(declval(Rng &))) iterator_t
Definition access.hpp:698
typename Fn::template invoke< Args... > invoke
Evaluate the invocable Fn with the arguments Args.
Definition meta.hpp:541
front< Pair > first
Retrieve the first element of the pair Pair.
Definition meta.hpp:2251
Definition adjacent_find.hpp:67
Definition comparisons.hpp:28
Definition identity.hpp:25