Chapter 11. Generic Algorithms

CONTENTS

Section 11.1 Overview 392

Section 11.2 A First Look at the Algorithms 395

Section 11.3 Revisiting Iterators 405

Section 11.4 Structure of Generic Algorithms 419

Section 11.5 Container-Specific Algorithms 421

Chapter Summary 424

Defined Terms 424

The library containers define a surprisingly small set of operations. Rather than adding lots of functionality to the containers, the library instead provides a set of algorithms, most of which are independent of any particular container type. These algorithms are generic: They operate on different types of containers and on elements of various types.

The generic algorithms, and a more detailed look at iterators, form the subject matter of this chapter.

The standard ...

Get C++ Primer, Fourth 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.