3 ms·
re: * Closures capturing their environment and keeping local variables alive longer than intended. How can that happen to a stack variable (and RAII is about
by mlvljr 11y ago
re:
* Closures capturing their environment and keeping local variables alive longer than intended.
How can that happen to a stack variable (and RAII is about those), given C++11/14's closures ("lambdas") do not prolongate the lifetime of the objects captured by reference? Or did you mean capture by value? (would be really confusing with RAII-ing classes :) )