CIS Logo SVC Logo

   Computing & Information Systems
   Department

 

Schoology Facebook        Search CIS Site      Tutorials

Software Design Using C++



The Standard Template Library (STL)


The Standard Template Library (STL) is a fairly recent and powerful addition to C++. Through the use of template-based container classes, iterators, algorithms, etc. the STL allows one to easily use common data structures such as lists and stacks that have already been implemented for you. In addition, one can use the STL to create various kinds of stacks, for example, within the same program. (Thus you could easily have a stack of floats and a stack of characters, both within the same program.)

The STL is large and somewhat complex. Only some of its features will be presented here. See the references below for further information. Some of the items not examined in these Web pages include certain container classes (such as deques, sets, and multimaps), some of the available class functions and algorithms, function objects, and allocators.

  • NOTE: Some of these examples have been revised in recent years, but others have not . Changes would probably be needed in some of them to get them to run today as the STL has evolved over the years.
  • STL Topics

    References:

    • C++ from the Ground Up, 2nd ed. Herbert Schildt. Osborne/McGraw-Hill (1998). See especially chapters 16 and 21.
    • C++ How to Program, 3rd ed. Deitel & Deitel. Prentice-Hall (2001).
    • The C++ Standard Libarary, 2nd ed. Nicolai M. Josuttis. Pearson Education, Inc. (2012)
    • Data Structures in C++ Using the Standard Template Library. Timothy Budd. Addison-Wesley (1998).
    • Data Structures with C++. William Ford, William Topp. Prentice-Hall (1996). Although this book does not cover the STL, it does provide material on templates and iterators, which are heavily used by the STL.
    • MFC Programming in C++ with the Standard Template Libraries. William H. Murray, Chris H. Pappas. Prentice-Hall PTR (2000). This book discusses templates, the standard template library, Microsoft Foundation Class programming, and graphics programming.
    • STL Programming from the Ground Up. Herbert Schildt. Osborne/McGraw-Hill (1999).
    • Teach Yourself C++, 5th ed. Al Stevens. MIS:Press (1997). Chapter 16 has a brief introduction to the STL.
    Back to the main page for Software Design Using C++

    Author: Br. David Carlson with contributions by Br. Isidore Minerd
    Last updated: September 19, 2022
    Disclaimer