#include <filter.hpp>
|
template<typename Pred > |
constexpr auto | operator() (Pred pred) const |
|
| template (typename Pred, typename Proj)(requires(!range< Pred >)) const expr auto operator()(Pred pred |
|
| template (typename Rng, typename Pred, typename Proj)(requires viewable_range< Rng > AND input_range< Rng > AND indirect_unary_predicate< Pred |
|
constexpr projected< iterator_t< Rng >, Proj > filter_view< all_t< Rng >, composed< Pred, Proj > > | operator() (Rng &&rng, Pred pred, Proj proj) const |
|
| template (typename Rng, typename Pred)(requires viewable_range< Rng > AND input_range< Rng > AND indirect_unary_predicate< Pred |
|
constexpr iterator_t< Rng > filter_view< all_t< Rng >, Pred > | operator() (Rng &&rng, Pred pred) const |
|
ranges::views::filter
The filter view takes in a predicate function T -> bool
and converts an input range of T
into an output range of T
by keeping all elements for which the predicate returns true.
Example
Output
Syntax
CPP_concept input_range
\concept input_range
Definition: concepts.hpp:103
CPP_concept output_range
\concept output_range
Definition: concepts.hpp:91
Parameters
filter_func
- Called once for each element of the input range
- Returns true for elements that should present in the output range
input_range
- The range of elements to filter
- Reference type:
T
output_range
- The range of filtered values
- Is either a
forward_range
or the concept satisfied by the input
- Is a
common_range
if the input is a common_range
- Is not a
sized_range
or borrowed_range
- Reference type:
T
◆ const
Proj proj ranges::views::filter_fn::const |
Initial value:{
return make_view_closure(
bind_back(filter_base_fn{}, std::move(pred), std::move(proj)))
defer< bind_back, Fn, Ts... > bind_back
Definition: meta.hpp:994
The documentation for this struct was generated from the following file: