C++ Logo

std-proposals

Advanced search

Re: [std-proposals] "once" keyword

From: Alejandro Colomar <alx.manpages_at_[hidden]>
Date: Wed, 24 May 2023 17:23:49 +0200
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;
}

Received on 2023-05-24 15:23:52