How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Reducing C++ template bloat by factoring out type-dependent portions of the function -- Raymond Chen

calendar_today September 25, 2026 person Blog Staff domain cplusplus

C++ templates make code reusable, but repeated expansions can quickly increase code size, especially when lambdas are involved. This article explores practical ways to reduce template bloat by separating type-dependent code from the common logic. Reducing C++ template bloat by factoring out type-dependent portions of the function by Raymond Chen From the article: C++ templates let you reuse code, but it comes at a cost: Each template expansion results in a different function.

open_in_new Read original post