Skip to content

Glossary: Software Design Patterns in C++

Template

Also written: templates, template<typename T>

C++ code written once for any type that fits, such as a function using `template <typename T>`. Types are checked at compile time, which is how C++ does duck typing.

Where the book teaches it

Related terms

ConceptDuck typing