From Jason Turner
Watch on YouTube

Summary

This episode explores C++26's expansion statements (template for), a powerful new feature that enables compile-time iteration over heterogeneous collections and structured bindings. Jason demonstrates three key use cases: visiting tuple elements with different types, destructuring arbitrary structs generically, and looping over constant expressions at compile time. The feature eliminates the need for complex template metaprogramming to iterate over tuple-like types and enables compile-time constant expression loops that were previously impossible.

Resources

Tags