Index: boost/functional/hash/hash.hpp =================================================================== --- boost/functional/hash/hash.hpp (revision 84899) +++ boost/functional/hash/hash.hpp (working copy) @@ -152,6 +152,15 @@ std::size_t seed = 0; T positive = val < 0 ? -1 - val : val; +#if defined(BOOST_MSVC) +#pragma warning(push) +#if BOOST_MSVC <= 1700 +#pragma warning(disable:6295) // Ill-defined for-loop : 'unsigned int' values + // are always of range '0' to '4294967295'. + // Loop executes infinitely. +#endif +#endif + // Hopefully, this loop can be unrolled. for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits) { @@ -159,6 +168,10 @@ } seed ^= (std::size_t) val + (seed<<6) + (seed>>2); +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + return seed; } @@ -172,6 +185,15 @@ std::size_t seed = 0; +#if defined(BOOST_MSVC) +#pragma warning(push) +#if BOOST_MSVC <= 1700 +#pragma warning(disable:6295) // Ill-defined for-loop : 'unsigned int' values + // are always of range '0' to '4294967295'. + // Loop executes infinitely. +#endif +#endif + // Hopefully, this loop can be unrolled. for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits) { @@ -179,6 +201,10 @@ } seed ^= (std::size_t) val + (seed<<6) + (seed>>2); +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + return seed; } }