mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
Add a BOOST_ASSERT to mix64_policy to check that the bucket_count is a power of two
This commit is contained in:
@ -2018,6 +2018,7 @@ namespace boost {
|
|||||||
|
|
||||||
static inline SizeT to_bucket(SizeT bucket_count, SizeT hash)
|
static inline SizeT to_bucket(SizeT bucket_count, SizeT hash)
|
||||||
{
|
{
|
||||||
|
BOOST_ASSERT( boost::core::has_single_bit( bucket_count ) );
|
||||||
return hash & (bucket_count - 1);
|
return hash & (bucket_count - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user