Summary
This episode celebrates the long-awaited addition of std::views::enumerate to C++23, a feature that many other programming languages have had for years. Jason demonstrates how the new feature works using GCC trunk in C++23 mode on Compiler Explorer, showing how it allows iterating over a container while simultaneously accessing both the index and value. This addition to the standard library eliminates the need for complex workarounds previously required to enumerate container elements in C++.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[basic.string]95% match -
[dcl.constexpr]85% match