August 2012
Intermediate to advanced
976 pages
30h 17m
English
mapThe map and unordered_map containers provide the subscript operator and a corresponding at function (§ 9.3.2, p. 348), which are described in Table 11.6 (overleaf). The set types do not support subscripting because there is no “value” associated with a key in a set. The elements are themselves keys, so the operation of “fetching the value associated with a key” is meaningless. We cannot subscript a multimap or an unordered_multimap because there may be more than one value associated with a given key.
Table 11.6. Subscript Operation for map and unordered_map
Like the other subscript operators we’ve used, the map subscript ...
Read now
Unlock full access