1.1 KiB
1.1 KiB
[range.cache.latest.overview]
25 Ranges library [ranges]
25.7 Range adaptors [range.adaptors]
25.7.34 Cache latest view [range.cache.latest]
25.7.34.1 Overview [range.cache.latest.overview]
cache_latest_view caches the last-accessed element of its underlying sequence so that the element does not have to be recomputed on repeated access.
[Note 1:
This is useful if computation of the element to produce is expensive.
â end note]
The name views::cache_latest denotes a range adaptor object ([range.adaptor.object]).
Let E be an expression.
The expression views::cache_latest(E) is expression-equivalent tocache_latest_view(E).