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]
Yes, the default value will be the default of that type. If you want another default, you can create a class that behaves like an int but has a different default constructor.