A capturing lambda can be a coroutine, but you have to save your captures while you still can

Will you use one?

A capturing lambda can be a coroutine, but you have to save your captures while you still can

by Raymond Chen

From the article:

We saw some time ago that capturing lambdas which are coroutines result in lifetime issues because the lambda itself returns at the first suspension point, at which point there’s a good chance it will be destructed. After that point, any attempt by the lambda body to access those captured variables is a use-after-free bug...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.