
David Abrahams skrev:
on Sun Dec 09 2007, Thorsten Ottosen <thorsten.ottosen-AT-dezide.com> wrote:
says that erase() does not throw for ordered containers (which is correct). Anyway, this means any argument used to assume that predicate evaluation is a no-throw should be the same for unordered containers.
No, the ordered containers don't do any predicate evaluation in erase().
How can you implement std::set<T>::erase( const T& ) then, if you are not going to find the equivalent elements by evaluating Pred(x,y)?
Why does erase( const_iterator ) (and range version), not provide the no-throw guarantee?
Why should it? Vector/deque erase don't.
Because it is a node based container.
Does erase give the strong guarantee otherwise?
Since erase(const Key&) for ordered containers cannot throw, so I guess it is implicitly required that Pred(x,y) must not throw?
Nope, see above.
Still don't get it. -Thorsten