KennyTM~:

> (Moreover, having .remove() to throw means you can't delete any 
> dictionary items in nothrow functions. Sure you can silent it with 
> try/catch but that's expensive.)

In nothrow functions you can use a different method, like "discard" (or a 
similar name less intuitive than remove), that's like remove, but it doesn't 
throw and just returns false when the key was absent.
The idea is to use the safer method by default and the less safe one as a 
performance optimization (or where you are sure you want that semantics) in the 
other places.

Bye,
bearophile

Reply via email to