cpp/ranges/filter view

@1@ A range adaptor that represents of an underlying sequence without the elements that fail to satisfy a predicate. @2@ . The expression is expression-equivalent to  for any suitable subexpressions  and.

models the concepts, , , and when the underlying   models respective concepts.

Data members
Typical implementations of hold two or three non-static data members:
 * the underlying of type  (shown here as  for exposition only),
 * a wrapper that wraps the predicate used to filter out elements of of type  (shown here as  for exposition only), where the wrapper augument  with assignability when needed and hence always satisfies ,
 * an object of std-like type (shown here as for exposition only) that caches an iterator to the first element of  that satisfies the . The  may be present only if  models.

Member functions
{{member|{{small|std::ranges::filter_view::}}filter_view|2= {{dcl begin}} {{dcl|since=c++20|num=1|1= filter_view requires std::default_initializable && std::default_initializable = default; }} {{dcl|since=c++20|num=2| constexpr explicit filter_view( V base, Pred pred ); }} {{dcl end}}

@1@ Value-initializes {{tti|base_}} via its default member initializer ({{c|1== V}}) and default-initializes {{tti|pred_}} (which value-initializes the contained {{tt|Pred}}). @2@ Initializes {{tti|base_}} with {{c|std::move(base)}} and initializes {{tti|pred_}} with {{c|std::move(pred)}}.

Parameters
}}