O'Reilly logo

Sams Teach Yourself C++ in One Hour a Day, Seventh Edition by Siddhartha Rao

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

Lesson 20. STL Map Classes

The Standard Template Library (STL) supplies the programmer with container classes that help with applications that require frequent and quick searches.

This lesson covers

• How STL map and multimap, unordered_map and unordered_multimap containers can be of use to you

• Insertion, removal, and search of elements

• Supplying a custom sort predicate

• Basics of how hash tables work

An Introduction to STL Map Classes

The map and multimap are key-value pair containers that allow for a lookup on the basis of a key as shown in Figure 20.1.

Image

Figure 20.1. Visual illustration of a container for pairs, each holding a key and a ...

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