Lesson 23. STL Algorithms

An important part of the Standard Template Library (STL) is a set of generic functions, supplied by the header <algorithm>, that help manipulate or work with the contents of a container. In this lesson, you find out

• How to use STL algorithms to reduce boiler-plate code

• Generic functions to help you count, search, find, and remove in addition to other operations in STL containers

What Are STL Algorithms?

Finding, searching, removing, and counting are some generic algorithmic activities that find application in a broad range of programs. STL solves these and many other requirements in the form of generic template functions that work on containers via iterators. To use STL algorithms, the programmer first has to include ...

Get Sams Teach Yourself C++ in One Hour a Day, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.