The Preprocessor: Everything You Need to Know and More!
summary
Preprocessor remains a text‑replacement engine that actually pastes headers into a translation unit (see -E preprocessor dump or Compiler Explorer to inspect .i output), inherited from C but diverging in C++ with modules still not ubiquitous. The talk demonstrates concrete pitfalls: directives have no scope, conditionals treat identifiers as numeric, double-evaluation in function-like macros causes side‑effects, and pragma pack push/pop can silently break serialization unless paired with pop. Practical tools and alternatives shown: __VA_OPT__ caveats, _Generic for C, constexpr/templates/source_location for C++ and use pragmas sparingly.
AI-written summary · about
chapters (5)
related talks
23mC preprossor macros from functional programs
01h 02mBack to Basics: The Structure of a Program
01h 03mto pass and return, the story of functions, values and compilers
55mHow bad is meta-programming still today?
01h 00mTeaching old compilers new tricks
01h 39mKeynote - C++ Metaprogramming: evolution and future direction
01h 02mEmbedded Friendly C++: Features That Make a Difference
07mCan I has grammar?
