This paper introduces the basic concepts of generic programming as practiced in C++. It explains how to use templates to implement general-purpose algorithms, containers, and iterators. A container is a data structure, such as a list, queue or vector, that holds other objects. An iterator is a mechanism for visiting each object in a container.


The paper presents alternative implementations for containers and iterators, with particular emphasis on the approach used in the C++ Standard Template Library (STL). It also discusses considerations for using containers and iterators efficiently.