Damir Tenishev
Damir Tenishev

Reputation: 3402

What is the replacement for range-v3 views::cache1 in std::ranges?

Is there any replacement for range-v3 views::cache1 in std::ranges?

Caching the most recent element could be quite helpful when it comes to heavy calculation for it.

Upvotes: 3

Views: 174

Answers (1)

康桓瑋
康桓瑋

Reputation: 43026

Nope in C++20/23.

However, P2760: A Plan for C++26 Ranges sets it to Tier 1 priority, which was eventually renamed to cache_latest and made it into C++26.

Upvotes: 5

Related Questions