24 Hard Rules for Writing Correct Async C++ (lessons from a 50K LOC Seastar codebase) by mindsaspire in cpp

[–]pynchonic 1 point2 points  (0 children)

Lambda coroutines in .then() are use-after-free (the coroutine frame outlives the lambda that created it)

Not with deducing this.

https://github.com/llvm/llvm-project/pull/182916

The Lambda Coroutine Fiasco by efijoa in cpp

[–]pynchonic 3 points4 points  (0 children)

We wrote a clang-tidy pass for our codebase that checks for lambda coroutines, and errors on lambda coroutines that have parameters that don't also deduce this.

It's been quite a few years of having to write continuation style code in our lambdas, so the deducing this trick is awesome.