Reputation: 3402
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
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