idvaluemap: add a remove_all method

This commit is contained in:
Maxime Coste 2013-04-11 14:27:32 +02:00
parent 4cf7c4175a
commit 172f46f679

View File

@ -54,14 +54,15 @@ public:
void remove(const Id& id) void remove(const Id& id)
{ {
for (auto it = m_content.begin(); it != m_content.end(); ++it) auto it = find(id);
{ if (it != end())
if (it->first == id)
{
m_content.erase(it); m_content.erase(it);
return;
}
} }
void remove_all(const Id& id)
{
for (auto it = find(id); it != end(); it = find(id))
m_content.erase(it);
} }
template<typename Condition> template<typename Condition>