C++ Logo

std-proposals

Advanced search

Re: [std-proposals] return if

From: Magnus Fromreide <magfr_at_[hidden]>
Date: Mon, 19 Jan 2026 03:27:45 +0100
On Mon, Jan 12, 2026 at 12:00:56AM +0000, Frederick Virchanza Gotham via Std-Proposals wrote:
>
> return if SomeFunction();

If you were to introduce

  return if

then I think it would be logical to also introduce

  co_return if

but if you do that then it would be odd to not have

  co_yield if

and that in turn suggests that

  co_yield while

also sould be permissible, don't you think so?

/MF

Received on 2026-01-19 02:27:50