Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-04-11 03:20:12


Thorsten Ottosen wrote:
> as a related issue, an array is a range, so why define hash_value for
> it?

So that you can call hash_combine with an array member, something like

struct X
{
    int a;
    long b[ 4 ];
};

size_t hash_value( X const & x )
{
    size_t seed = 0;

    hash_combine( seed, x.a );
    hash_combine( seed, x.b );

    return seed;
}


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