~/talk

Back to Basics: Lambdas from Scratch

Talkat CppCon 2019 · 2019-09-15..09-20· [c-and-cpp]
slides:none on file

Explains lambdas as compiler-generated unnamed class objects with an operator() and shows assembly via Godbolt to prove it; walks concrete examples from C functions, overloading, templates, member operator(), to C++11/14/17/20 lambda semantics like lambda = unnamed class with operator() , captures by value/reference/move including capture [t = std::move(title)] , generic lambdas with auto parameters, captureless conversion to function pointers, and why std::function rejects move-only captures (shared_ptr workaround and unique_function proposal).

AI-written summary · about

  1. 0:00Introduction
  2. 1:13Functions and overloading
  3. 5:57Member functions
  4. 9:06Operator overloading
  5. 10:10Lambda basics
  6. 12:32Capturing variables
  7. 16:58Dangling references
  8. 17:59Move capture
  9. 19:14Capture shorthands
  10. 20:23Global variable capture
  11. 22:21Captureless lambdas
  12. 23:54Unary plus trick
  13. 24:59Default and constexpr
  14. 26:17Local state and mutable
  15. 30:29Generic lambdas
  16. 33:50Variadic lambdas
  17. 34:55This keyword in lambdas
  18. 38:59Explicit this capture
  19. 40:51Generic lambda type names
  20. 43:04Lambdas vs std function
  21. 47:30Type erasure overview
  22. 49:00Move-only lambdas
  23. 51:57Q&A
~/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.