std::map mapy; ++mapy[5];
Is it safe to assume that mapy[5] will always be 1? I mean, will mapy[5] always get
mapy[5]
As soon as you access the map with the [] operator, if the key doesn't exist it gets added. The default initializer of the int type gets invoked - so it will get a value of 0.