forked from boostorg/container_hash
Take care of g++ warning on 4294967291
This commit is contained in:
1 parent
7f2a43226e
commit
24598bd45f
1 file changed
+2
-1
@@ -87,7 +87,8 @@ namespace boost
|
||||
static std::size_t fn( T v )
|
||||
{
|
||||
// 4294967291 = 2^32-5, biggest prime under 2^32
|
||||
return static_cast<std::size_t>( static_cast<typename boost::make_unsigned<T>::type>( v ) % 4294967291 );
|
||||
// we use boost::uint32_t( -5 ), because g++ warns on 4294967291
|
||||
return static_cast<std::size_t>( static_cast<typename boost::make_unsigned<T>::type>( v ) % static_cast<boost::uint32_t>( -5 ) );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user