Chapter 10. Associative Containers

CONTENTS

Section 10.1 Preliminaries: the pair Type 356

Section 10.2 Associative Containers 358

Section 10.3 The map Type 360

Section 10.4 The set Type 372

Section 10.5 The multimap and multiset Types 375

Section 10.6 Using Containers: Text-Query Program 379

Chapter Summary 388

Defined Terms 388

This chapter completes our review of the standard library container types by looking at the associative containers. Associative containers differ in a fundamental respect from the sequential containers: Elements in an associative container are stored and retrieved by a key, in contrast to elements in a sequential container, which are stored and accessed sequentially by their position within the container.

Although the ...

Get C++ Primer, Fourth 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.