Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2007-12-11 11:48:56


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk