- November 3, 2004 at 11:28 am #1870willParticipant
by John Kopp
The Standard Template Library, or STL, is a collection of container classes, generic algorithms and related components that can greatly simplify many programming tasks in C++. The container classes, as you might surmise from the name, are classes used to hold objects of any particular type. Among the methods of the container classes are methods to add and remove elements, return elements and return iterators. Iterators are an abstraction of pointers. They provide a means to traverse containers and access objects within containers. The generic algorithms are a collection of routines that can be used to perform common operations on container classes, such as sorting, merging and finding. The are called generic because they are independent of the container class used and of the datatype of the objects held in those container classes. The iterators are used to link a container with an algorithm. A container class has methods to return iterators that provide access to its contents. These iterators are provided, as arguments, to an algorithm. The algorithm can then traverse, access and manipulate the contents of the container.
This lesson introduces the components of the STL and provides some simple examples. The rest of the lessons of the tutorial will examine each of these components in greater detail.
You can find the whole tutorial at
Hopefully you will find this tutorial a complete and comprehensive on Standard Template Library.
- You must be logged in to reply to this topic.