forked from boostorg/unordered
Update some comments for recent versions of standard
This commit is contained in:
@@ -2653,12 +2653,14 @@ struct table : boost::unordered::detail::functions<typename Types::hasher,
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
// From 6.3.1/13:
|
// From insert/emplace requirements:
|
||||||
// size < mlf_ * count
|
//
|
||||||
// => count > size / mlf_
|
// size <= mlf_ * count
|
||||||
|
// => count >= size / mlf_
|
||||||
//
|
//
|
||||||
// Or from rehash post-condition:
|
// Or from rehash post-condition:
|
||||||
// count > size / mlf_
|
//
|
||||||
|
// count >= size / mlf_
|
||||||
|
|
||||||
return policy::new_bucket_count(
|
return policy::new_bucket_count(
|
||||||
boost::unordered::detail::double_to_size(
|
boost::unordered::detail::double_to_size(
|
||||||
@@ -3100,10 +3102,7 @@ inline void table<Types>::reserve_for_insert(std::size_t size)
|
|||||||
{
|
{
|
||||||
if (!buckets_) {
|
if (!buckets_) {
|
||||||
create_buckets((std::max)(bucket_count_, min_buckets_for_size(size)));
|
create_buckets((std::max)(bucket_count_, min_buckets_for_size(size)));
|
||||||
}
|
} else if (size > max_load_) {
|
||||||
// According to the standard this should be 'size >= max_load_',
|
|
||||||
// but I think this is better, defect report filed.
|
|
||||||
else if (size > max_load_) {
|
|
||||||
std::size_t num_buckets =
|
std::size_t num_buckets =
|
||||||
min_buckets_for_size((std::max)(size, size_ + (size_ >> 1)));
|
min_buckets_for_size((std::max)(size, size_ + (size_ >> 1)));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user