C++ STL map::effacer un non-existant clé

Concernant le C++ STL carte, l'effacement par la touche:-

 size_type map::erase ( const key_type& x );

Est-il légal pour effacer un non-existant? c'est à dire l'extrait de code ci-dessous ok?

map<char,int> mymap;
mymap['c']=30;
mymap.erase('c');
mymap.erase('c');
mymap.erase('D');

Acclamations

InformationsquelleAutor fuad | 2009-03-30