16.2.13 Standard Template Library

back: standard library headers
forward: compiler quirks
 
fastback: exceptions
up: changeable c++
fastforward: compiler quirks
top: autoconf, automake, and libtool
contents: table of contents
index: index
about: about this document

The Standard Template Library (STL) is a library of containers, iterators and algorithms. I tend to think of the STL in terms of the container classes it provides, with algorithms and iterators necessary to make these containers useful. By segregating these roles, the STL becomes a powerful library--containers can store any kind of data and algorithms can use iterators to traverse the containers.

There are about half a dozen STL implementations. Since the STL relies so heavily on templates, these implementations tend to inline all of their method definitions. Thus, there are no precompiled STL libraries, and as an added bonus, you're guaranteed to get the source code to your STL implementation. Hewlett-Packard and SGI produce freely redistributable STL implementations.

It is widely known that the STL can be implemented with complex C++ constructs and is a certain workout for any C++ compiler. The best policy for choosing an STL is to use a modern compiler such as GCC 2.95 or to use the STL that your vendor may have provided as part of their compiler.

Unfortunately, using the STL is pretty much an `all or nothing' proposition. If it is not available on a particular system, there are no viable alternatives. There is a macro in the Autoconf macro archive (see section 23.5.1 Autoconf macro archive) that can test for a working STL.


This document was generated by Gary V. Vaughan on May, 24 2001 using texi2html


GNU Autoconf, Automake and Libtool
GNU Autoconf, Automake, and Libtool
ISBN: 1578701902
EAN: 2147483647
Year: 2002
Pages: 290

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net