~/lightning

Lightning Talk: Into the Lambdaverse - Weird C++ Lambda Shenanigans

Lightningat C++Now 2023 · 2023-05-07..05-12· [c-and-cpp]
links:none on file
slides:none on file

Explains why modifying a captured variable sometimes fails: lambda's operator() is const unless mutable is used, but init-captures introduce an implicit auto variable whose deduced type (and constness) determines the captured member, so a const original can yield a const capture. Shows the surprising fix of writing n = n to force a mutable copy, cites post-C++23 rule changes about parentheses, and traces behavior back to the standard's wording about no extra copy.

AI-written summary · about

  1. 0:00Intro
  2. 1:20ClosureType
  3. 2:13ReferenceType
  4. 2:52C Standard
~/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.