Tuple iteration in C++ has always been the kind of problem that reveals how far the language’s type system can stretch before it buckles. The type-heterogeneous nature of std::tuple means you cannot use a runtime loop; you need to do something at compile time. For years, that meant reaching for std::apply, index sequences, or recursive template instantiation, all of which work but none of which read like natural C++.
C++26 changes this with two proposals: structured binding packs (P1061) and expansion statements (P1306). Bartlomiej Filipek’s article on isocpp.org, published last November and the final installment of a tuple-iteration mini-series, covers these additions in detail alongside the C++20 and C++23 approaches that came before. It is worth reading end to end.
Structured Binding Packs
The structured binding pack extension is the more fundamental of the two. In C++17, structured bindings let you write:
auto [a, b, c] = some_tuple;
But you had to know the arity at the call site. With P1061, you can write:
auto&&... elems = my_tuple;
This gives you a pack of references that you can expand with ... just like a variadic template parameter pack, usable in fold expressions and pack expansions without needing to know the element count explicitly.
Expansion Statements
The expansion statement (P1306) builds on this with a template for syntax:
template for (auto& elem : my_tuple) {
process(elem);
}
This is compile-time unrolling, but it reads like a range-based for loop. Each iteration is instantiated separately for each element type, so you get the full power of compile-time dispatch without writing the machinery yourself.
Why This Is More Than Convenience
The older approaches with std::apply or index sequences have sharp edges. You can accidentally capture by value, mess up perfect forwarding, or produce subtle problems in certain template contexts. The new syntax makes the intent clear and leaves less room for accidental mistakes.
There is also a readability argument worth taking seriously. C++ has a reputation for code that is difficult to read even when it is correct, and tuple manipulation has been one of the worst offenders. Showing a new developer the std::make_index_sequence pattern for the first time tends to produce a specific expression. The template for syntax does not eliminate the need to understand what is happening at compile time, but it makes the loop structure obvious on first reading.
Availability
C++26 is still taking shape, and not all features land in compilers simultaneously. These proposals have been approved into the working draft, but practical availability depends on implementation progress. For production code, you will encounter the old techniques in existing codebases for years regardless. Filipek’s article is a good reference for understanding both the new design and the patterns you are likely to inherit.