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]
1
#
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
]
2
#
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 to
cache_
latest_
view
(
E
)
.