Chapter 5. Utilities

This chapter describes the general utilities of the C++ standard library. These utilities are small and simple classes, types, or functions that perform frequently needed tasks:

• Class pair<> and class tuple<>

• Smart pointer classes (class shared_ptr<> and class unique_ptr)

• Numeric limits1

1 One could argue that numeric limits and class ratio<> should be part of Chapter 17, which covers numerics, but these classes are used in some other parts of the library, so I decided to describe them here.

• Type traits and type utilities

• Auxiliary functions (for example, min(), max(), and swap())

• Class ratio<>1

• Clocks and timers

• Some important C functions

Most, but not all, of these utilities are described in clause 20, “General ...

Get C++ Standard Library, The: A Tutorial and Reference, 2nd 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.