|
Boost : |
From: Jeremy Maitin-Shepard (jbms_at_[hidden])
Date: 2004-01-02 19:48:52
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. 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, the issue
could be avoided by caching the hash codes.
-- Jeremy Maitin-Shepard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk