You clearly have never programmed anything required advanced
algorithms and data containers.
An exercise: Write a function (which is as short and simple, but also
as fast as possible) which answers the question "has this string been
seen before?" (When it is asked that question with some string, that
string is then considered "seen" from that point forward.)
Yes, you can do that with a vector, but it won't be fast.
Just FWIW, that's not a very good example for using a map though --
I, at least, would do that with a set instead.
A better (IMO, anyway) example of using a map would be if you were
writing an interpreter for a small programming language (e.g. BASIC).
A map would be a simple, straightforward way of storing the values of
the variables. When the code being interpreted had something like:
Let x = 1
your program would (internally) use something like:
floats['x'] = 1;
or more accurately, something like:
floats[variable_name] = value;
You'd probably have something like three symbol tables, one each for
strings, floats and ints (and as-per the rules of most older BASICs
anyway) you'd figure out the type from the suffix on the name.
If you wanted an example of a multimap, consider building a
concordance of words -- e.g. for each word you encounter, you keep
track of all the places (e.g. filename and line) where that word can
be found. If you wanted to enhance it a bit, you could use a set
(about like in the first example above) to hold really common words
you did NOT want to store in the concordance. When you were building
the concordance, you'd look each word up in that list, and only store
positions of words that weren't found in the list.
There is a multiset, but frankly, I've never seen much use for it. At
least in most cases, it appears that a multiset<T> can be replaced
with a map<T, int> pretty easily, and will probably run faster and
use less storage.