© J. Burton Browning and Bruce Sutherland 2020
J. B. Browning, B. SutherlandC++20 Recipeshttps://doi.org/10.1007/978-1-4842-5713-5_8

8. The STL Algorithms

J. Burton Browning1  and Bruce Sutherland2
(1)
Bolivia, NC, USA
(2)
Carnegie, VIC, Australia
 

The STL provides a set of algorithms that can be used along with the containers that it also supplies. These algorithms all work with iterators. An iterator is an abstraction mechanism that allows traversal behavior on many different STL collections. This chapter covers iterators and some of different algorithms along with their uses.

Recipe 8-1. Using an Iterator to Define a Sequence Within a Container

Problem

You have an STL container and would like to mark a sequence within that container that begins and ends ...

Get C++20 Recipes: A Problem-Solution Approach 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.