From Jason Turner
Watch on YouTube

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++.

Resources

Tags