Horizon
Loading...
Searching...
No Matches
unique.hpp
Go to the documentation of this file.
1
2// Range v3 library
3//
4// Copyright Eric Niebler 2013-present
5//
6// Use, modification and distribution is subject to the
7// Boost Software License, Version 1.0. (See accompanying
8// file LICENSE_1_0.txt or copy at
9// http://www.boost.org/LICENSE_1_0.txt)
10//
11// Project home: https://github.com/ericniebler/range-v3
12//
13
14#ifndef RANGES_V3_VIEW_UNIQUE_HPP
15#define RANGES_V3_VIEW_UNIQUE_HPP
16
17#include <utility>
18
19#include <meta/meta.hpp>
20
22
25#include <range/v3/utility/static_const.hpp>
27#include <range/v3/view/all.hpp>
29
30#include <range/v3/detail/prologue.hpp>
31
32namespace ranges
33{
36 namespace views
37 {
39 {
40 template(typename Rng, typename C = equal_to)(
44 operator()(Rng && rng, C pred = {}) const
45 {
46 return {all(static_cast<Rng &&>(rng)), not_fn(pred)};
47 }
48 };
49
51 {
52 using unique_base_fn::operator();
53
54 template(typename C)(
55 requires (!range<C>))
56 constexpr auto operator()(C && pred) const
57 {
58 return make_view_closure(
59 bind_back(unique_base_fn{}, static_cast<C &&>(pred)));
60 }
61 };
62
65 RANGES_INLINE_VARIABLE(view_closure<unique_fn>, unique)
66 } // namespace views
68} // namespace ranges
69
70#include <range/v3/detail/epilogue.hpp>
71
72#endif
The forward_range concept.
The indirect_relation concept.
The range concept.
The viewable_range concept.
decltype(begin(declval(Rng &))) iterator_t
Definition access.hpp:698
Tiny meta-programming library.
Definition adjacent_filter.hpp:63
Definition comparisons.hpp:28
Definition not_fn.hpp:34
Definition unique.hpp:39
Definition unique.hpp:51
Definition view.hpp:178