Date: Wed, 29 Jan 2025 06:38:09 +0000
You can have a wrapper function (not coroutine) that returns std::generator.
std::generator<T> wrapper(ReferenceType x) {
return [](ValueType x)->std::generator<T>{
/*implement coroutine*/
}(DeepCopy(x));
}
DeepCopy(x) is evaluated before the initial suspend and its result lives on the coroutine frame.
On 28 January 2025 18:43:20 GMT, Karl Semich via Std-Proposals <std-proposals_at_[hidden]> wrote:
>--
>Std-Proposals mailing list
>Std-Proposals_at_[hidden]
>https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
std::generator<T> wrapper(ReferenceType x) {
return [](ValueType x)->std::generator<T>{
/*implement coroutine*/
}(DeepCopy(x));
}
DeepCopy(x) is evaluated before the initial suspend and its result lives on the coroutine frame.
On 28 January 2025 18:43:20 GMT, Karl Semich via Std-Proposals <std-proposals_at_[hidden]> wrote:
>--
>Std-Proposals mailing list
>Std-Proposals_at_[hidden]
>https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-01-29 06:38:18