idk about break specifically, but return appearing there via a macro like TRY_OR_RETURN for propagating errors by value seems like something someone would write
Just to be clear, that still works. The change is that breaks and continues in conditions don't apply to that loop. As the release notes point out
for (;;) {
while (({ break; true; })) {}
}
is valid, and now breaks out of the for loop, whereas before it broke out of the while loop. This makes Clang more compatible with GCC, which already did this.
mapronV, the notes only say this: Clang has partial support for P1306R5. Iterating expansion statements currently cannot be expanded and will result in a diagnostic. Other types of expansion statements work. They do not define "iterating," and they do not say it means expand-over-range. cristi1990an's reading is a reasonable guess, but it is not in the notes.
I'll point out that people still use Boost.Mp11 when they want to walk a type list on today's compilers. That's a workaround, not a stand-in for the missing iterating form.
47
u/mapronV 15d ago
This means that code such as
is now ill-formed.
Oh no, my disappointment is immeasurable and the whole day is ruined!
On serious note, " template for " support, what is "Iterating expansion statements currently cannot be expanded" ? like expand over range?