CHAPTER 4

image

Map Containers

You retrieve an element from a sequence container by its position. You can access the first or last element of a deque, for example, or an element in a vector by its index position. Map containers work quite differently, as this chapter will explain. In this chapter you’ll learn the following:

  • What is meant by an associative container.
  • What a map container is and how it is typically organized.
  • The types of map containers that are available and their capabilities.
  • The functions that map containers provide.
  • What a pair is and what it is used for.
  • What a tuple is and how you use it.

Introducing Map Containers

The sequence ...

Get Using the C++ Standard Template Libraries 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.