This chapter introduces the C++ concept known as templates, which promote the use of reusable code by allowing you to create generic versions of useful functions. Each template can be used with a variety of different data types—both built-in and user-defined—and reused in different situations.
Part of the reason this chapter introduces templates is to also cover and discuss the Standard Template Library (or STL). This library contains some useful generic definitions of classes and functions to manipulate them.
This chapter is divided into two sections:
The first section discusses template functions and template classes, whereas the second looks at specific classes and functions ...