In the C++14 standard, section [map.access]
the text is:
T& operator[](const key_type& x);
- Effects: If there is no key equivalent to
x
in the map, inserts value_type(x, T())
into the map.
So, as also stated by Joseph Garvin's answer, the result of the expression mapped_type()
is what is inserted. This sort of initialization is called value-initialization.
The meaning of value-initialization is not quite as simple as offered in the other answers, for class types. It depends on what sort of constructors the class type has, and whether the class is an aggregate, as explained by the cppreference link.
For int
as in this question, value-initialization means the int
is set to 0
.