Link: Mitch Richling's Home Page

© 2009 Mitch Richling

Example STL Programs

Here you will find several examples of source code intended to illustrate concepts related to the C++ STL. The intent of this page is to help beginning STL programmers with a few complete examples. The makefile is here.

Containers

list.cc
Demonstrates several list container concepts including splice.
vector.cc
Demonstrates one of the most useful containers in the STL!
set.cc
Short demonstration of the set container.
map.cc
Demonstrates the map container.
multiset.cc
Short demonstration of the multiset container.

Algorithms

algorithm.cc
Demonstrates several generic algorithms. (This is a work in progress)
little_algorithm.cc
Demonstrates things like swap, min, and max. (This is a work in progress)
generic.cc
Example of how to write generic functions to work with STL containers.

Adapters & non-containers

queue.cc
Demonstrates the use of the queue container adapter. (This is a work in progress)
string.cc
A few C++ string examples and how the work with C-strings.
© 2009 Mitch Richling