O'Reilly logo

The C++ Standard Library: A Tutorial and Reference, Second Edition by Nicolai M. Josuttis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required