O'Reilly logo

Professional C++ by Scott J. Kleper, Nicholas A. Solter

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 28. Standard Library Reference

This reference shows the most useful classes and functions in the standard library.

Note that the syntax "[start, end)" refers to a half-open iterator range from start to end, as described in Chapter 21.

Containers

The STL divides its containers into three categories. The sequential containers include the vector, list, and deque. The associative containers include the map, multimap, set, and multiset. The container adapters include the stack, queue, and priority_queue. Additionally, the bitmap and string can be considered STL containers as well.

Common Typedefs

Most sequential and associative containers that are part of the standard define the following types, which have public access and are used in the method prototypes. Note that not all these typedefs are required by the standard in order to qualify as an STL container. However, most of the containers in the STL provide them (exceptions are noted after the following table).

Type Name

Description

value_type

The element type stored in the container.

reference

A reference to the element type stored in the container.

const_reference

A reference to a const element type stored in the container.

pointer

A pointer to the element type with which the container is instantiated (not required by the standard, but defined by all the containers).

const_pointer

A pointer to a const element type with which the container is instantiated (not required by the standard, but defined by all the containers).

iterator ...

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