~/talk

C++: λ Demystified

Talkat NDC Oslo 2019 · 2019-06-17..06-21· [c-and-cpp]
slides:none on file

Lambda implementation is shown as compiler-generated closure classes using C++ Insights, revealing that captures become members and call operator(s) and that reordering captures can shrink a closure from 12→8 bytes on x86-64. Examples expose traps: returning a reference-capturing lambda causes dangling references, copying members captures the this pointer (prints 4 then 5 unless dereferenced), and unused copy-captures still force allocation causing three unused-variable warnings; also five syntactic places allow lambdas to appear.

AI-written summary · about

  1. 0:00Start
  2. 2:58The Evolution of Lambdas
  3. 5:34Trailing Return Type
  4. 7:23Lambdas Internals
  5. 9:04Call Operator
  6. 17:32Conversion Operator
  7. 22:44Generic Lambdas
  8. 25:29The Dangling Reference Trap
  9. 38:46An Unused Variable Warning
  10. 41:47C + + 17
  11. 43:48Apply Lambdas
  12. 45:57Immediately Invoked Function Expressions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.