~/talk

Cute C++ Tricks (and what you can learn from them): Part 2 of N

Talkat CppNorth 2022 · 2022-07-18..07-20· [c-and-cpp]
links:none on file
slides:none on file

Part 2 unpacks concrete, reproducible surprises: using assert (not static_assert) inside constexpr functions, a template+lambda+concept trick to count aggregate members by constructing with objects convertible to anything, workarounds for copy/move overload ambiguity and move-only types, and a reflection-like destructure-to-callback that lets you serialize aggregates. A Google-used implementation has a bug. The session ends with the dangerous technique of stateful metaprogramming via friend injection and WG21’s unresolved plan to ban it.

AI-written summary · about

  1. 0:00Introduction and goal
  2. 3:45Talk disclaimers and rules
  3. 5:50Understanding constexpr
  4. 10:44Ill-formed no diagnostic
  5. 13:15Assert in constexpr
  6. 15:58Constexpr in C++23
  7. 18:31Counting aggregate members
  8. 21:03Creating n copies
  9. 23:08Deducing template packs
  10. 27:49Fixing conversion issues
  11. 34:05Move-only type handling
  12. 38:27Disambiguation techniques
  13. 42:14Aggregate restrictions
  14. 45:31Metaprogramming reflection
  15. 47:33Stateful metaprogramming
  16. 54:48Conclusion 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.