Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Unordered throws 64-bit portability warnings
From: JOAQUIN M. LOPEZ MUÑOZ (joaquin_at_[hidden])
Date: 2009-05-21 15:52:24


________________________________________
De: boost-users-bounces_at_[hidden] [boost-users-bounces_at_[hidden]] En nombre de Daniel James [daniel_james_at_[hidden]]
Enviado el: jueves, 21 de mayo de 2009 21:36
Para: boost-users_at_[hidden]
Asunto: Re: [Boost-users] Boost.Unordered throws 64-bit portability warnings

2009/5/21 Dominique Devienne <ddevienne_at_[hidden]>:
> >
> > FWIW, I'm getting these as well when using
> > boost::hash_combine(hash_value(this->member_)); to implement hashes
> > for my classes. We also use VS2005 with the compiler switch that
> > raises these warnings. My work around below is not pretty... --DD
> >
> > #if ACME_SIZEOF_SIZE_T == 4
> > // Avoid warning C4267: 'argument' :
> > // conversion from 'size_t' to 'unsigned int', possible loss of data
> > boost::hash_combine(
> > seed, static_cast<unsigned int>(hash_value(member_))
> > );
> > #else
> > boost::hash_combine(seed, hash_value(member_));
> > #endif
>
> Doesn't 'boost::hash_combine(seed, member_)' work?
>
> I'll have a look at the warning when I get the chance, but AFAICT
> they're wrong since when compiling for 64-bit a different overload or
> template resolution would be chosen.

Is this maybe related to http://lists.boost.org/boost-users/2007/03/26388.php ?

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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