Skip to main content

Chapter 23 Templates and Array Lists

In this chapter, we will explore how to write generic code using templates. Generics allow us to create functions and classes that can operate on different data types.
We will also learn about a simple data structure, the array list, that uses templates to allow storage of any data type.

Note 23.0.1.

Templates are an enormously powerful and complex feature of C++. We will only be making use of a small subset of their capabilities in this book.