C++ Logo

std-proposals

Advanced search

Re: [std-proposals] "once" keyword

From: Alejandro Colomar <alx.manpages_at_[hidden]>
Date: Wed, 24 May 2023 18:18:19 +0200
On 5/24/23 16:27, David Brown via Std-Proposals wrote:
> 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!

I think the keyword you're looking for is `}` :P


>
>
>
>

Received on 2023-05-24 16:18:22