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 <> 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