Horizon
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ranges::views::cache1_fn Struct Reference

Public Member Functions

 template (typename Rng)(AND input_range< Rng > AND const ructible_from< range_value_t< Rng >
 Caches the most recent element within the view so that dereferencing the view's iterator multiple times doesn't incur any recomputation.
 
range_reference_t< Rng > constexpr cache1_view< all_t< Rng > > operator() (Rng &&rng) const
 

Member Function Documentation

◆ template()

ranges::views::cache1_fn::template ( typename Rng  ) const

Caches the most recent element within the view so that dereferencing the view's iterator multiple times doesn't incur any recomputation.

This can be useful in adaptor pipelines that include combinations of view::filter and view::transform, for instance.

Note
views::cache1 is always single-pass.

The documentation for this struct was generated from the following file: