O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Algorithms

The STL algorithms are designed to make working with the STL containers and other data types easier by abstracting many useful programming tasks as functions. This section covers the algorithms in terms of the STL containers introduced in the previous section of this chapter.

In all of the following examples, iterators refer to a specific item in the collection—using a reference to the current item in the collection. This reference can be increased or decreased, depending on whether the iterator is a forward or backward (or bi-directional) iterator. Most of the STL algorithms work with collections contained in containers.

So, if the collection is based on the vector template class, you can access items in the collection using the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required