~/talk

Back to Basics: Lambdas

Talkat CppCon 2021 · on Wednesday, 2021-10-27· at 12:30· online· [typescript]
slides:none on file

Shows exactly what lambdas do and how they differ from functions: the compiler generates a closure type with an operator() and captures become members; lambdas can capture by value (so returned function objects keep runtime parameters) or by reference, become mutable state when allowed, and instantiate as templates with C++14 generic lambda auto parameters. Demonstrates concrete uses: sort with case‑insensitive lexicographical_compare, count_if/find_if predicates, C++20 ranges/projections, conversion to function pointers when no captures, and surprising copies when algorithms take callables by value.

AI-written summary · about

  1. 0:00Intro
  2. 1:40Why Lambdas
  3. 8:10Countif
  4. 10:38Sorting
  5. 16:50Generic Lambda
  6. 19:25No Lambdas
  7. 30:49Behind the scene
  8. 34:46The rule
  9. 36:46Templates
  10. 39:38Functions vs Lambdas
  11. 44:38Local copy of elements
  12. 45:38Prefix
  13. 51:16Copy if
  14. 54:50Questions
~/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.