4 ms·
> FWIW, I find std::map operator[] creating an object extremely convenient and it is very annoying having to use defaultdict to get the same behavior [edit: in
by eqvinox 7y ago
> FWIW, I find std::map operator[] creating an object extremely convenient and it is very annoying having to use defaultdict to get the same behavior [edit: in python]. So ugliness really depends on what you are used to.
Adding behavior to replace a NULL/None return with a default object is pretty easy.
Removing the default object that you've been inflicted upon... how would you go about that?
- gpderetta 7y agoif you do not like operator[] behaviour just use map::at