Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-03-22 14:04:42


"Daniel James" <daniel_at_[hidden]> wrote in message
news:d1pooj$7ia$1_at_sea.gmane.org...
| Thorsten Ottosen wrote:
|
| > Even so, does the extreamely rare situation, that a hash-container is used
as
| > index in a hash-container,
| > justify that we should not use a generic default ?
|
| But that was just a specific example of a general point - that we can't
| define a hash function for an object when we don't know what its
| equality function is.
|
| Another example:

My point has been that it is up to the programmer to
make sure that equal objects has the same hash value.

Your point is that it could be the wrong hash value.

I don't see why we should guard against this; the user must always make sure
that equal objects have the same hash value; consider just what happens when
the user adds a new data member to the class and updates equality but forgets
to
update the hash value or vice versa.

So I think that we are just getting a false sense of security out of leaving
the default
empty.

-Thorsten


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