C++ Logo

std-proposals

Advanced search

Re: [std-proposals] return if

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Mon, 19 Jan 2026 12:48:38 +0000
On Mon, Jan 19, 2026 at 2:27 AM Magnus Fromreide wrote:
>
> 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?



I like your forward thinking, but let me implement "return if" in the
GNU g++ compiler first, and we can take it from there.

Received on 2026-01-19 12:48:51