13#ifndef RANGES_V3_ALGORITHM_UNIQUE_COPY_HPP
14#define RANGES_V3_ALGORITHM_UNIQUE_COPY_HPP
20#include <range/v3/algorithm/result_types.hpp>
30#include <range/v3/utility/static_const.hpp>
32#include <range/v3/detail/prologue.hpp>
39 template<
typename I,
typename O>
40 using unique_copy_result = detail::in_out_result<I, O>;
45 template<
typename I,
typename S,
typename O,
typename C,
typename P>
46 constexpr unique_copy_result<I, O> unique_copy_impl(I first,
51 std::input_iterator_tag,
58 iter_value_t<I>
value =
62 while(++first != last)
67 value = (
decltype(x) &&)x;
76 template<
typename I,
typename S,
typename O,
typename C,
typename P>
77 constexpr unique_copy_result<I, O> unique_copy_impl(I first,
82 std::forward_iterator_tag,
90 while(++first != last)
95 *out = (
decltype(x) &&)x;
104 template<
typename I,
typename S,
typename O,
typename C,
typename P>
105 constexpr unique_copy_result<I, O> unique_copy_impl(I first,
110 std::input_iterator_tag, std::true_type)
115 while(++first != last)
119 *++out = (
decltype(x) &&)x;
128 RANGES_FUNC_BEGIN(unique_copy)
147 constexpr unique_copy_result<I, O> RANGES_FUNC(unique_copy)(
148 I
first, S last, O out, C pred = C{}, P proj = P{})
150 return detail::unique_copy_impl(std::move(first),
155 iterator_tag_of<I>(),
160 template(
typename Rng,
typename O,
typename C =
equal_to,
typename P =
identity)(
166 constexpr unique_copy_result<borrowed_iterator_t<Rng>, O>
167 RANGES_FUNC(unique_copy)(Rng && rng, O out, C pred = C{}, P proj = P{})
169 return detail::unique_copy_impl(begin(rng),
178 RANGES_FUNC_END(unique_copy)
182 using ranges::unique_copy;
183 using ranges::unique_copy_result;
188#include <range/v3/detail/epilogue.hpp>
The forward_iterator concept.
The indirect_relation concept.
The indirectly_copyable_storable concept.
The indirectly_copyable concept.
The sentinel_for concept.
The weakly_incrementable concept.
decltype(begin(declval(Rng &))) iterator_t
Definition access.hpp:698
constexpr T static_const< T >::value
Definition static_const.hpp:29
std::integral_constant< bool, B > bool_
An integral constant wrapper for bool.
Definition meta.hpp:168
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