11.3.5. Accessing Elements
The associative containers provide various ways to find a given element, which are described in Table 11.7 (p. 438). Which operation to use depends on what problem we are trying to solve. If all we care about is whether a particular element is in the container, it is probably best to use
find. For the containers that can hold only unique keys, it probably doesn’t matter whether we use
count. However, for the containers with multiple keys,
count has to do more work: If the element is present, it still has to count how many elements have the same key. If we don’t need the count, it’s best to use
Exercise 11.24: ...