C++ Logo

std-proposals

Advanced search

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

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Wed, 18 Dec 2024 22:10:15 +0100
On 18/12/2024 11.49, Jan Schultke via Std-Proposals wrote:
> I want to have break/continue statements with labels in C++. Now is the time.
>
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm has been
> accepted into C2y, with the syntax:
>
> label: for (/* ... */) {
> while (true) { break label; }
> }
>
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf proposes to
> update this syntax to
>
> for label (/* ... */) {
> while (true) { break label; }
> }
>
> While N3377 may be a bit more syntactically sound (not reusing labels
> that are otherwise only goto targets, I'm not a fan of that idea.

I think the strictly worst option would be if WG14 picked
the N3377 syntax, but WG21 picked the N3355 syntax.
So, WG21 needs to know WG14's opinion on N3377 before
committing to anything.

Jens

Received on 2024-12-18 21:10:18