C++ Logo

std-proposals

Advanced search

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

From: Jan Schultke <janschultke_at_[hidden]>
Date: Fri, 20 Dec 2024 15:03:10 +0100
> > Sure, but what is the technical reason why you need different syntax?
>
> That it's separate from labels and thus not subject to being a target of a goto.

It's true that such labels cannot be targeted by goto. However, it
does not create any parsing ambiguities, missed optimizations, etc. if
they can. This is solving a non-technical problem. This is enshrining
rules into the language to suit personal preferences.

> No, the reason is to separate those targets so ...
> ... and can be reasoned about where they jump and how.

"Keeping things separated" and "reasoning" are very subjective goals.

You personally feel more comfortable with keeping these labels
separated. It can totally understand that and respect your preference.

It's easier for you to understand the code with two separate sets of
labels. I even agree that it's *objectively* easier to reason about
code with two separate pools. Nonetheless, two separate pools can be
created through naming conventions just as well as with hard language
rules.


Anyhow, thank you for your input. We may not agree, but it was very helpful! :)

Received on 2024-12-20 14:03:25