Not everything in a typical library is a class. In recent years, programmers have paid increasing attention to the use of templates, which describe common “patterns” for similar classes and functions that differ only in a few names.
Templates come in two varieties
Class templates are patterns for similar classes. Function templates are patterns for similar functions.
In this lesson, we'll explore why the idea of a pattern for several different codes can be useful.