On Thu, May 21, 2009 at 2:07 PM, Lindley M French
I've noticed on Visual Studio 2005 that I get a slew of warnings from Boost/unordered/detail/hash_table_impl.hpp when I build with "Detect 64-bit portability issues" turned on. In particular at the moment I'm seeing the following warning:
boost/unordered/detail/hash_table_impl.hpp(1569) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
And the same on lines 1328, 1569, 1541, 1799, and 1763.
I doubt this poses a real problem, but with hash tables you never know. I'd prefer not to see warnings when I build. Can this be fixed, and can regression testing using this build setting be added to the mix in general?
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