Check out the new USENIX Web site. next up previous contents
Next: Algorithms Up: Extending the Standard Template Previous: Introduction

Generic Programming and the Standard Template Library

  The generic programming paradigm prescribes four kinds of abstractions: data abstractions, algorithmic abstractions, structural abstractions, and representational abstractions.

Data abstractions are data types and sets of operations on them. C++ provides templates as the necessary constructs for data abstractions. Templates provide a uniform interface and implementation abstractions for different data types. For instance, a template stack class can be instantiated to a stack of integers, doubles, or any user-defined type. Thus, for N data types only one template container class is provided which can be instantiated N ways.

STL provides implementations for the remaining three abstractions through STL algorithms, iterators, and adaptors. These are discussed below.




Sundaresan Neelakantan
Thu May 15 16:11:49 PDT 1997