This paper introduces templates, the C++ facility for implementing generic classes and functions. It explains the basic capabilities of function templates and class templates. It also explains template compilation mechanisms including instantiation, specialization, and argument deduction.

This is a discussion of general-purpose C++ programming features and techniques, which are useful in, but not specific to, embedded systems.