std::experimental::ranges::find,std::experimental::ranges::find_if, (3) Linux Manual Page
std::experimental::ranges::find,std::experimental::ranges::find_if, – std::experimental::ranges::find,std::experimental::ranges::find_if,
Synopsis
Defined in header <experimental/ranges/algorithm>
template< InputIterator I, Sentinel<I> S, class T, class Proj =
ranges::identity >
requires IndirectRelation<ranges::equal_to<>, projected<I, Proj>,
const T*>
I find(I first, S last, const T &value, Proj proj = Proj{});
template <InputRange R, class T, class Proj = ranges::identity>
requires IndirectRelation<ranges::equal_to<>,
projected<ranges::iterator_t<R>, Proj>, const T*>
ranges::safe_iterator_t<R> find(R &&r, const T &value, Proj proj =
Proj{});
template <InputIterator I, Sentinel<I> S, class Proj =
ranges::identity,
(3)(ranges TS)
IndirectUnaryPredicate<projected<I, Proj>>
Pred>
I find_if(I first, S last, Pred pred, Proj proj = Proj{});
template <InputRange R, class Proj = ranges::identity,
IndirectUnaryPredicate<projected<ranges::iterator_t<R>, Proj>>
>
ranges::safe_iterator_t<R> find_if(R&& r, Pred pred, Proj proj =
Proj{});
template< InputIterator I, Sentinel<I> S, class Proj =
ranges::identity,
(5) (ranges TS)
IndirectUnaryPredicate<projected<I, Proj>> Pred >
I find_if_not(I first, S last, Pred pred, Proj proj = Proj{});
template< InputRange R, class Proj = ranges::identity,
IndirectUnaryPredicate<projected<ranges::iterator_t<R>, Proj>>
>
ranges::safe_iterator_t<R> find_if_not(R&& r, Pred pred, Proj proj =
Proj{});
Returns the first element in the range
criteria:
1)
==
3)
true
5)
false
2,4,6)
as first and ranges::end(r)
Notwithstanding the declarations depicted above, the actual number and order of
template parameters for algorithm declarations is unspecified. Thus, if explicit
template arguments are used when calling an algorithm, the program is probably
non-portable.
Parameters
first, last – the range of elements to examine
r
value
pred
proj
Return value
Iterator to the first element satisfying the condition. If no such element is found,
returns an iterator that compares equal to last.
Complexity
At most last – first applications of the predicate and projection.
Possible implementation
First version
template<
I find(I first, S last, const T&
{
}
Second version
template<
I find_if(I first, S last, Pred pred, Proj proj
{
}
template<
I find_if_not(I first, S last, Pred pred, Proj proj
{
}
Example
See also
find
find_if
find_if_not
(C++11)
adjacent_find predicate)
find_end
find_first_of searches for any one of a set of elements
mismatch
search
