Chapter 20. STL set and multiset

The standard template library (STL) supplies the programmer with container classes that help with applications requiring frequent and quick searches.

In this lesson, you will learn

  • An introduction to the STL set and multiset

  • Basic STL set and multiset operations

  • Advantages and disadvantages in using these containers

An Introduction

The set and multiset are containers that facilitate a quick lookup of keys in a container that stores them; that is, the keys are the values stored in the one-dimensional container. The difference between the set and the multiset is that the latter allows for duplicates whereas the former can store only unique values.

Figure 20.1 is only demonstrative and indicates that a set of names contains ...

Get Sams Teach Yourself C++ in One Hour a Day, Sixth 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.