Boost logo

Boost Users :

Subject: Re: [Boost-users] unordered_map: user object as key
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-02-27 14:41:34


AMDG

André Santee wrote:
> I solved my problem by doing this:
>
> namespace boost
> {
> std::size_t hash_value(const GS_VECTOR2 &v2)
> {
> return ((std::size_t)v2.y*COLUMNS)+(std::size_t)v2.x;
> }
> };
>
> Is it also ok?
>

You might get a better hash using boost::hash_value and boost::hash_combine

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net