Boost logo

Boost :

Subject: [boost] [functional/hash] integer hash function
From: Tim Blechmann (tim_at_[hidden])
Date: 2011-10-04 16:03:09

i was quite amazed that the default hash function for integers seems to be the
identity function:

from boost/functional/hash/hash.hpp:
    inline std::size_t hash_value(int v)
        return static_cast<std::size_t>(v);

while this is probably the most efficient hash function, it is also the worst
possible. is this done intentionally?


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