C++ Logo

std-proposals

Advanced search

Re: [std-proposals] "once" keyword

From: Alejandro Colomar <alx.manpages_at_[hidden]>
Date: Wed, 24 May 2023 18:19:54 +0200
On 5/24/23 17:59, David Brown via Std-Proposals wrote:
> On 24/05/2023 17:23, Alejandro Colomar via Std-Proposals wrote:
>>
>>
>> On 5/24/23 15:48, David Brown via Std-Proposals wrote:
>>> I think a better idea here would be to propose allowing "break" inside
>>> an "if" statement. That would be simpler, clearer, and have more
>>> potential applications - instead of your "once" you'd write "if (true)",
>>> and instead of "once (condition)" you'd write "if (condition)".
>>
>> That would be incompatible with things like:
>>
>> for (;;) {
>> if (x)
>> break;
>> }
>
> Yes, as has been pointed out to me, I didn't think things through very well.

No problem. We all have brain farts every now and then :-)
>
>

Received on 2023-05-24 16:19:57