Coming to Terms with C++ Templates
This paper examines the use of C++ templates in embedded systems from two different viewpoints. First, it addresses the reputation that templates have for code bloat, explaining how template instantiation occurs and can be controlled, as well as describing techniques that are useful for limiting bloat. Secondly, it describes two applications of templates, one layering type-safety on top of void-based containers without adding any runtime cost, the second detecting dimensional unit type errors during compilation — behavior that cannot be implemented in C. The information in this paper is an overview of more detailed information covered in the conference presentation.
Please disable any pop-up blockers for proper viewing of this Whitepaper.