Skip to Main Content
Professional C++, 6th Edition
book

Professional C++, 6th Edition

by Marc Gregoire
February 2024
Intermediate to advanced content levelIntermediate to advanced
1376 pages
40h 6m
English
Wiley
Content preview from Professional C++, 6th Edition

20Mastering Standard Library Algorithms

As Chapter 18, “Standard Library Containers,” shows, the Standard Library provides an impressive collection of generic data structures. Most libraries stop there. The Standard Library, however, contains an additional assortment of generic algorithms that can, with some exceptions, be applied to elements from any container. Using these algorithms, you can find, sort, and process elements in containers and perform a host of other operations. The beauty of the algorithms is that they are independent not only of the types of the underlying elements, but also of the types of the containers on which they operate. Algorithms perform their work using only the iterator or ranges interfaces, discussed in Chapter 17, “Understanding Iterators and the Ranges Library.”

The Standard Library comes with a large set of unconstrained algorithms, all working solely with iterators. These algorithms don't have any constraints in the form of concepts; see Chapter 12, “Writing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming: Principles and Practice Using C++, 3rd Edition

Programming: Principles and Practice Using C++, 3rd Edition

Bjarne Stroustrup
C++ Primer, Fifth Edition

C++ Primer, Fifth Edition

Stanley B. Lippman, Josée Lajoie, Barbara E. Moo

Publisher Resources

ISBN: 9781394193172