Range-v3
Range algorithms, views, and actions for the Standard Library
ranges::find_fn Struct Reference

Public Member Functions

template<typename I , typename S , typename V , typename P = identity>
auto operator() (I begin, S end, V const &val, P proj=P{}) const -> I requires input_iterator< I > &&sentinel_for< S, I > &&indirect_relation< equal_to, projected< I, P >, V const * >
 template function find_fn::operator() More...
 
template<typename Rng , typename V , typename P = identity>
auto operator() (Rng &&rng, V const &val, P proj=P{}) const -> safe_iterator_t< Rng > requires input_range< Rng > &&indirect_relation< equal_to, projected< iterator_t< Rng >, P >, V const * >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Member Function Documentation

◆ operator()()

template<typename I , typename S , typename V , typename P = identity>
auto ranges::find_fn::operator() ( begin,
end,
V const &  val,
proj = P{} 
) const -> I requires input_iterator<I> && sentinel_for<S, I> && indirect_relation<equal_to, projected<I, P>, V const *>

template function find_fn::operator()

range-based version of the find std algorithm

Precondition
Rng is a model of the Range concept
I is a model of the input_iterator concept
S is a model of the sentinel_for<I> concept
P is a model of the invocable<iter_common_reference_t<I>> concept
The ResultType of P is equality_comparable with V