Logo

Programming-Idioms

History of Idiom 172 > diff from v12 to v13

Edit summary for version 13 by chardan:
[Cpp] Other examples don't actually use underscores in the identifiers.

Version 12

2019-09-27, 22:07:14

Version 13

2019-09-27, 22:07:47

Idiom #172 Insert entry in map

Insert value v for key k in map m.

Idiom #172 Insert entry in map

Insert value v for key k in map m.

Extra Keywords
associative
Extra Keywords
associative
Code
_m[_k] = _v;
Code
m[k] = v;
Comments bubble
std::map<>::operator[] will either insert or update the value.
Comments bubble
std::map<>::operator[] will either insert or update the value.