std::map::erase() can take a key directly and has no-throw guarantee.

This commit is contained in:
Tsuda Kageyu 2015-05-22 01:26:56 +09:00
parent d4b0ba2a7a
commit 54de66f275

View File

@ -145,9 +145,7 @@ template <class Key, class T>
Map<Key, T> &Map<Key,T>::erase(const Key &key)
{
detach();
Iterator it = d->map.find(key);
if(it != d->map.end())
d->map.erase(it);
d->map.erase(key);
return *this;
}