Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-02 20:46:45

Jeremy Maitin-Shepard <jbms_at_[hidden]> writes:

> David Abrahams <dave_at_[hidden]> writes:
>> Jeremy Maitin-Shepard <jbms_at_[hidden]> writes:
>>> The behavior of rehash in the case that an exception is thrown by the
>>> hash function is not specified in the proposal. In this
>>> implementation, if an exception is thrown by a hash function during a
>>> rehash operation, the hash table is cleared. This appears to be better
>>> behavior than leaving the container in state where it contains an
>>> arbitrary set of elements.
>> Why is that better? It seems overconstrained to me.
> I have a hard time seeing what a user would do with the remaining
> elements other than erase them.

Shouldn't that be up to the user? If the user wants to terminate()
the program immediately, should she have to pay for the erasure

Why is an cleared hash table any more useful than any other state it
might end up in?

> Also, if the elements are not
> cleared, there are three possibilities for choosing which set of
> elements to include: the elements in the existing buckets, the elements
> in the new buckets, or the largest set of elements.

Or some unspecified set of elements. It doesn't really matter.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at