C++ Logo

std-proposals

Advanced search

Re: [std-proposals] "once" keyword

From: LUCE Jean-Sébastien <jseb.luce_at_[hidden]>
Date: Wed, 24 May 2023 16:35:41 +0200
Yes this was why I talked about another keyword, changing "if" behaviour
(with break) would create big mess with all existant c++ code.

I agree with most of our comments, yet I still found "goto" syntax not
ideal.

And found it strange to have no "return" equivalent in a sub part of a
function.

Le mer. 24 mai 2023 à 16:28, David Brown via Std-Proposals <
std-proposals_at_[hidden]> a écrit :

> On 24/05/2023 15:49, Arthur O'Dwyer via Std-Proposals wrote:
>
> > David Brown wrote:
> > > I think a better idea here would be to propose allowing "break"
> > inside an "if" statement.
> >
> > As in `if (x > 5) break;`? I think you should rethink that idea. ;)
> >
>
> Good point :-)
>
> I was, obviously, thinking about cases with a block - "if (x) { ... }".
> But of course a "break" there would currently mean breaking out of an
> enclosing "while" or "for", so my suggestion still would not work. I
> still think it would be useful to have a way of breaking out of an "if",
> but not at the cost of breaking existing code!
>
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2023-05-24 14:35:58