~/lightning

Lightning Talk: Can't we Just Synthesize std::tuple_element From Get?

Lightningat CppCon 2024 · on Sunday, 2024-09-15· [typescript]
links:none on file
slides:none on file

Claims synthesis: std::tuple_element can be computed as decltype(get(obj)) so structured bindings wouldn’t need separate specializations. Implements a detector that calls get on lvalue and rvalue (and const variants) to see if the element is reference-preserving and then strips or keeps references accordingly. Fails on proxy/transform-like types where calling get twice is expensive or ill-formed and on subtle temporary/lifetime cases, so it works for many types but breaks for proxy ranges and cannot fully replace the standard requirement.

AI-written summary · about

  1. 0:00Introduction
  2. 0:24The problem with tuples
  3. 1:17First attempt at a solution
  4. 1:47Second attempt and refinement
  5. 2:08Third attempt and more failures
  6. 2:42Final attempt at a solution
  7. 2:57Issues with transformation
  8. 3:29The case against tuple_element
  9. 3:55Structured bindings and get
  10. 4:53Conclusion and Q&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.