~/talk

Are We Macro-free Yet?

Talkat CppCon 2019 · 2019-09-15..09-20· [software-architecture]
links:none on file
slides:none on file

Describes removing macros from a C++17 codebase by replacing conditional compilation with compile-time booleans (e.g. has_blast variable), moving implementation choices into a pimpl + dependency inversion layer, and using immediate lambdas and context-sensitive constexpr to avoid #ifdef-driven interfaces. Builds a macro-free logging replacement using C++20 formatting and lazy evaluation, and parameterizes tests across backends with doctest parameterized tests. Result: code compiles with optional toolchains (CUDA) via shared headers, no build-time slowdown, and higher confidence in correctness.

AI-written summary · about

  1. 0:00Introduction
  2. 2:22Why eliminate macros
  3. 6:55Problems with conditional compilation
  4. 10:03If-constexpr as alternative
  5. 14:15Replacing macro replacements
  6. 22:33Dependency inversion principle
  7. 33:12Macros from third-party libraries
  8. 39:04Strategy to remove macros
  9. 45:12Q&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.