Lightning Talk: Global API Injection in C++
summary
A C++ pattern injects platform-level globals (logging, timing, networking) by specializing a base template so leaf code calls a function that resolves to a variable template or, pre-C++14, a function template with return-type deduction. Clients provide a one-line specialization or accept a default; this eliminates passing APIs through layers, supports testing without I/O redirection, and compiles in C++14 (not C++11). The approach is used in Compiler Explorer examples and in a compile-time build and reports practical success.
AI-written summary · about
related talks
01h 01mDependency Injection in C++ - A Practical Guide
01h 01m“Template Normal Programming (part 2 of 2)"
46mTestability and C++ API Design
03mLightning Talk: C++ Catastrophes: A Poem
01h 06mModern C and What We Can Learn From It
01h 07mDynamic Polymorphism With Code Injection and Metaclasses
54mGeneric Programming Without (Writing Your Own) Templates
53mC++ Horizons
