Article

C++26 Ranges: Four New Views

Sandor Dargo ·Sandor Dargo's Blog ·Published 2026-10-14 ·5 min read

This article discusses four new views introduced in C++26 ranges, providing insights into their functionality and usage. It serves as the first part of a series exploring the enhancements in C++26 ranges.

From the article

C++20 shipped a powerful ranges library, but the set of view adaptors had some obvious gaps. Want to get the output as a container? No luck. At least C++23 helped with that . Want to iterate over two vectors as one sequence? Write your own. Want to avoid redundant evaluations in a transform | filter pipeline? Write a workaround. Want a quick index sequence matching a range’s size? Spell out iota with an ugly cast.

C++26 fills four of these gaps with new views: views::concat , views::to_input , views::cache_latest , and views::indices .

This was one of the most requested additions. P2542R8 gives us views::concat , which lazily concatenates any number of ranges into a single view:


Share this resource


Discovered 2026-10-15 Source Sandor Dargo's Blog Archive 2026-10 →