+5  A: 

operator[] performs a two step process. First it finds or creates a map entry for the given key, then it returns a reference to the value part of the entry so that the calling code can read or write to it.

In the case where entry didn't exist before, the value half of the entry needs to be default constructed before it is assigned to. This is just the way the interface needs to work to be consistent with the case where the entry already existed.

If need to use such a type in a map then you have to avoid the use of operator[] by using find and insert "manually".

Charles Bailey
To be precise, `operator[]` does not assign, but return a reference to the newly created value. The assignment is user code.
David Rodríguez - dribeas
@dribeas: Yes, true. I shall update for the pedants!
Charles Bailey