Tag: capture
4 posts
-
C++ Lambda Capture: By Value, By Reference, Init Capture, and the Lifetime Bugs Each One Invites
How C++ lambda captures really work: copies taken at creation time, [=] silently capturing this, mutable state duplicated by std::function, move-only captures, and dangling references.
-
C++ Lambda Expressions: Capture Modes, mutable, Generic Lambdas and Dangling References
C++ lambda expressions: [=]·[&] capture, sort and find_if usage, mutable, generic lambdas, threads, and dangling-reference pitfalls—practical guide.
-
Lambdas That Crash Later: Dangling Reference Captures and How to Capture Safely
Why a stored C++ lambda crashes long after creation: dangling [&] captures, the hidden this in [=], move-only captures and std::function, and safe patterns.
-
C++ Lambda Basics: [=] and [&] Capture, mutable, and Lambdas with STL Algorithms
C++ lambdas: [=] [&] capture, mutable, generic lambdas, std::function recursion pitfalls, STL algorithms, and dangling reference bugs—practical guide.