Bug [ 1314453 ] AssocVector<>: hinted insert does not preservedering. Thanks to Christopher Twigg

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@294 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2005-10-10 15:02:57 +00:00
parent d772eacd50
commit ebde306337
2 changed files with 77 additions and 5 deletions

View file

@ -175,13 +175,12 @@ namespace Loki
}
return std::make_pair(i, !found);
}
//Section [23.1.2], Table 69
//http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/libstdc++/23_containers/howto.html#4
iterator insert(iterator pos, const value_type& val)
{
if (pos != end() && this->operator()(*pos, val) &&
(pos == end() - 1 ||
!this->operator()(val, pos[1]) &&
this->operator()(pos[1], val)))
if( (pos == begin() || this->operator()(*(pos-1),val)) &&
(pos == end() || this->operator()(val, *pos)) )
{
return Base::insert(pos, val);
}