C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] async coroutines vs. lambdas
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2020-05-14 08:53:56


On Thu, 14 May 2020 at 16:31, Marcin Jaczewski via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> And code like:
>
> ```
> lazy<int> get_custom_lambda() {
> struct X
> {
> int i = 3;
> lazy<int> operator()(){ co_return i; }
> } x();
> return x();
> }
>
> ```
>
> This still crash, and this is same code as `get_real_lambda`.
> How do you like fix it? and what if lambda is not movable?

If I swap those co_return/return, will this code then work?


STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups