August 2012
Intermediate to advanced
976 pages
30h 17m
English
In addition to the types listed in Table 9.2 (p. 330), the associative containers define the types listed in Table 11.3. These types represent the container’s key and value types.
Table 11.3. Associative Container Additional Type Aliases
For the set types, the key_type
and the value_type
are the same; the values held in a set are the keys. In a map, the elements are key–value pairs. That is, each element is a pair object containing a key and a associated value. Because we cannot change an element’s key, the key part of these pairs is const:
set<string>::value_type v1; // v1 is a stringset<string>::key_type ...
Read now
Unlock full access