Map/Unordered Map: Our Associative Containers
Maps and unordered maps are associative containers. Elements within a map/unordered map are associated with a key and are accessed through this key. No two elements within a map/unordered map can have the same key. Internally, maps are sorted by keys using an internal comparison object. Conversely, elements in an unordered map are not sorted by keys, but are stored in a fashion that allows fast retrieval of elements by their key. Maps are generally more suited for iterating over and looking up keys, whereas unordered maps are more efficient at accessing elements directly by their associated key. If you end up looping through your data and using each element in some way, then a map is most suitable; if you are mostly grabbing an element from the container by its key and not looping over the entire collection, then an unordered map is the most suitable.
Constructing Maps and Unordered Maps
Here is a selection of constructors to use...