The Lambda Coroutine Fiasco
https://github.com/scylladb/seastar/blob/master/doc/lambda-coroutine-fiasco.mdIt's amazing C++23's "deducing this" could solve the lambda coroutine issue, and eliminate the previous C++ voodoo.
44
Upvotes
View all comments
Show parent comment
1
u/efijoa Dec 18 '25
It is not only a return type problem; the library side needs to know whether the future state should take ownership of the passed-in callable object. It seems this is coupled with the implementation details of the Seastar Future, so that pre-C++23 solution is actually prevent the transfer of ownership and bind the lifetime of the lambda to the parent scope.