~/talk

++namedtuple: Python style Named Tuples in C++20

Talkat Meeting C++ 2021 · 2021-11-10..11-12· [python]
links:none on file
slides:none on file

Implements Python-style named tuples in C++20 with a concrete snippet (namedtuple{"price"_t = 42, "size"_t = 1'000u}) using "price"_t UDL and a small std::fixed_string helper to make each name a unique compile-time type. Uses Concepts, new lambda tricks and operator[] to do operator[] compile-time lookup, provides std::tuple_size/get shims so structured bindings work, and shows a ~100-line C++20 reference implementation that prints and converts to JSON. Benchmarks find compilation time comparable or sometimes faster than std::tuple; packing optimization is demonstrated as doable.

AI-written summary · about

  1. 0:00Start
  2. 1:35The Motivation so Name Tuples Are Coming from Python
  3. 2:28Main Issues with the Sdx
  4. 4:53Benefit of Potential Tuple Implementations of the Structs
  5. 5:03Draw Polymorphism
  6. 14:05Metastract
  7. 25:36Implementation
  8. 39:12Nested Composite Tuples
  9. 45:10Immediately Invoked Function Expression
  10. 45:52Printing the Tuple
  11. 48:07Showcase
  12. 51:28The Benchmark of Compilation Times
~/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.