~/talk

Back To Basics: Lambda Expressions

Talkat CppCon 2020 · 2020-09-14..09-18· [compilers-and-language-design]
links:none on file
links:none on file
slides:none on file

Covers concrete C++11→20 changes: capture semantics happen at lambda evaluation, so capturing int x by value prints the original value; move capture makes closure non-copyable so it cannot be stored in std::function; generalized captures let code move unique_ptrs into closures and rename captures; C++17 adds capturing this vs this semantics and C++20 adds template parameters, requires and deprecates default this by value; structured bindings become capturable in C++20 with a portable workaround structured binding capture workaround 'x = x'*

AI-written summary · about

  1. 0:00Introduction to Lambda Expressions
  2. 1:12CopperSpice Project Overview
  3. 2:15Origin of Lambda Term
  4. 4:23Function Pointers Explained
  5. 6:52Function Objects and Functors
  6. 10:05Lambda Expression Structure
  7. 12:53Capture Clause Basics
  8. 17:08Capture by Value and Reference
  9. 20:39Generalized Capture in C++14
  10. 23:10Capturing this in Class Methods
  11. 25:43Default Capture and Global Variables
  12. 27:29Lambda Evaluation vs Invocation
  13. 28:52Captures and Function Pointers
  14. 29:35Parameter List and Return Type
  15. 31:45Specifying Return Types
  16. 32:07C++20 Lambda Enhancements
  17. 33:51constexpr and consteval Lambdas
  18. 34:56Exception Specifiers
  19. 35:42Function Attributes
  20. 36:47Requires Clause in Lambdas
  21. 37:52Why Lambda Expressions Matter
  22. 39:15Compiler-Generated Function Objects
  23. 41:00Lambda as Callback Example
  24. 43:49Capturing Non-Copyable Objects
  25. 47:19Storing Closures in Functions
  26. 48:28Lambda in std::map Comparison
  27. 50:15Generic Lambda Explained
  28. 52:02Structured Bindings Capture Issue
  29. 53:46Summary and Key Takeaways
  30. 54:28Q&A Session Part 1
  31. 57:41Q&A Session Part 2
~/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.