map<int,int> default values

Posted by Bill Kotsias on Stack Overflow See other posts from Stack Overflow or by Bill Kotsias
Published on 2010-04-19T12:31:55Z Indexed on 2010/04/19 12:33 UTC
Read the original article Hit count: 226

Filed under:
|
|

Hello. I have this :

std::map<int,int> mapy;
++mapy[5];

Is it safe to assume that mapy[5] will always be 1? I mean, will mapy[5] always get the default value of 0 before '++', even if not explicitly declared, as in my code?

Cheers

© Stack Overflow or respective owner

Related posts about c++

Related posts about map