~/talk

Using type_traits and constexpr to make code more readable/debuggable

Talkat CppCon 2017 · 2017-09-24..09-29· [rust]
links:none on file
slides:none on file

Macro-based reflection for serialization gets replaced by real type traits and constexpr so generated code disappears and debugging becomes possible. The code uses enable_if and is_trivially_copyable to choose implementations, then simplifies to one overload with if constexpr so trivial-copy paths compile away. Compile-time string hashing moves from recursive constexpr to loop-based constexpr, and a user-defined literal removes remaining macros; the resource system accepts std::vector and the approach actually works.

AI-written summary · about

  1. 0:00Start
  2. 1:13The Macro Version
  3. 2:34Yay no macros
  4. 3:47Constexpr loops
  5. 4:32Can we get rid of more macros?
  6. 4:46User-defined literals to the rescue
~/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.