[range.cache.latest.overview]

# 25 Ranges library [[ranges]](./#ranges)

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.cache.latest.overview)

### 25.7.34 Cache latest view [[range.cache.latest]](range.cache.latest#overview)

#### 25.7.34.1 Overview [range.cache.latest.overview]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L17363)

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[.](#1.sentence-1)

[*Note [1](#note-1)*:

This is useful if computation of the element to produce is expensive[.](#1.sentence-2)

â *end note*]

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L17371)

The name views​::​cache_latest denotes
a range adaptor object ([[range.adaptor.object]](range.adaptor.object "25.7.2 Range adaptor objects"))[.](#2.sentence-1)

Let E be an expression[.](#2.sentence-2)

The expression views​::​cache_latest(E) is expression-equivalent tocache_latest_view(E)[.](#2.sentence-3)
