C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Bringing break/continue with label to C++

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Thu, 19 Dec 2024 08:05:33 +0000
> I mean, dear lord, what if we make goto slightly less intuitive to use by stealing the label syntax for loop labels? It just doesn't matter, as long as we don't break existing uses.

It will break all current usages of labels that have one of those control flow gadgets following it.
But the question is, do we need to?
It is not like there aren't alternative ways to express this.
There's already a precedent for:
if <put some stuff that modifies the behavior here> (<condition>)
(ex. if constexpr () )
Why couldn't
for <extra properties of the for loop, like the name> ()
work as well?

Received on 2024-12-19 08:05:35