fix ordering behavior of insert to match doc

This commit is contained in:
Guenter Obiltschnig
2015-12-10 09:46:11 +01:00
parent fbf10469b3
commit dfe52ac11c

View File

@@ -140,19 +140,8 @@ public:
/// Returns iterator pointing to the newly inserted value /// Returns iterator pointing to the newly inserted value
{ {
Iterator it = find(val.first); Iterator it = find(val.first);
while (it != _list.end() && isEqual(it->first, val.first)) ++it;
if (it == _list.end()) return _list.insert(it, 1, val);
{
_list.push_back(val);
it = _list.end();
--it;
}
else
{
_list.insert(it, 1, val);
}
return it;
} }
void erase(Iterator it) void erase(Iterator it)