Horizon
Loading...
Searching...
No Matches
find_if_not.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#ifndef RANGES_V3_ALGORITHM_FIND_IF_NOT_HPP
14#define RANGES_V3_ALGORITHM_FIND_IF_NOT_HPP
15
16#include <utility>
17
19
28#include <range/v3/utility/static_const.hpp>
29
30#include <range/v3/detail/prologue.hpp>
31
32namespace ranges
33{
36 RANGES_FUNC_BEGIN(find_if_not)
48 template(typename I, typename S, typename F, typename P = identity)(
50 indirect_unary_predicate<F, projected<I, P>>)
51 constexpr I RANGES_FUNC(find_if_not)(I first, S last, F pred, P proj = P{})
52 {
53 for(; first != last; ++first)
54 if(!invoke(pred, invoke(proj, *first)))
55 break;
56 return first;
57 }
58
60 template(typename Rng, typename F, typename P = identity)(
61 requires input_range<Rng> AND
63 constexpr borrowed_iterator_t<Rng> //
64 RANGES_FUNC(find_if_not)(Rng && rng, F pred, P proj = P{})
65 {
66 return (*this)(begin(rng), end(rng), std::move(pred), std::move(proj));
67 }
68
69 RANGES_FUNC_END(find_if_not)
70
71 namespace cpp20
72 {
73 using ranges::find_if_not;
74 }
76} // namespace ranges
77
78#include <range/v3/detail/epilogue.hpp>
79
80#endif
The indirect_unary_predicate concept.
The input_iterator concept.
The input_range concept.
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 identity.hpp:25