C++: λ Demystified
summary
Demonstrates how lambdas compile by using C++ Insights to show the closure class, call operator, and conversion to a function pointer for stateless lambdas; shows a surprising size change from 12 to 8 bytes by reordering captures and how init-capture creates named members; explains generic lambdas become templated call operators, dangling-reference capture causes undefined behavior, capturing this copies a pointer, and C++20 adds move capture for efficient pack forwarding and default-constructible lambdas plus practical RAII cleanup via a stored lambda.
AI-written summary · about
chapters (13)
- 0:00Start
- 2:23Lambdas and the Evolution of Lambdas
- 6:23Trailing Return Type
- 8:50C + + Insights
- 18:03Returning Dead Static Function
- 23:04Generic Lambdas and Generic Landers
- 25:13What Can We Do with Generic Lambdas
- 26:23The Dangling Reference Strap
- 43:08Parameter Lists
- 46:04File Descriptor Leak
- 46:48Implementation of Final Action
- 48:34Lambda Captures
- 55:12Examples of Lambda
related talks
59mTaming Lambdas' uniqueness
01h 10mThe Three Little Dots and the Big Bad Lambdas
11mThe New Old Thing, of Fun with Lambdas
01h 05mC++11 in the Wild: Techniques from a Real Codebase
50mThinking Functionally in C++
01h 09mFunctional Programming in C++
33mC++: Unexpected Behaviour
49mImprove your C++ with inspirations from other languages
