~/talk

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

Talkat CppCon 2021 · on Sunday, 2021-10-24· [typescript]
links:none on file
slides:none on file

Shows a concrete C++20 library that reproduces Python-style named tuples: implements namedtuple{"price"_t = 42, "size"_t = 1'000} and name tags like "price"_t via user-defined literals and non-type template parameters (std::fixed_string), uses Concepts, new lambda features and UDLs, and provides operator[] lookup, structure-bindings by specializing std::tuple_size/tuple_element and get, JSON printing, and composition. Implementation is ~100 lines of TMP, it compiles and runs, and benchmarks show roughly a single-digit-to-~20% compile-time cost versus std::tuple.

AI-written summary · about

  1. 0:00Start
  2. 1:31Agenda
  3. 11:26Json
  4. 13:42Raw Polymorphism
  5. 17:38Named Tuple
  6. 19:56Udl Approach
  7. 20:33Fixed String Implementation
  8. 20:46Implementation
  9. 25:06Name Tuple and Multiple Parameters
  10. 26:32Implement the Get by Name
  11. 30:40The Raw Polymorphism
  12. 32:09What Is Not Working
  13. 35:47Implement the Get
  14. 37:26Structure Bindings
  15. 37:47Function Expressions
  16. 38:55Printing the Tuple
  17. 39:56Packed Name Tuple
  18. 40:45Questions
  19. 44:22Json Implementation
  20. 52:02Debug Version
~/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.