forked from boostorg/unordered
Update code to be valid when the internal buckets_
data member is moved-from
This commit is contained in:
@@ -1586,6 +1586,10 @@ namespace boost {
|
||||
template <class T, class H, class P, class A>
|
||||
float unordered_set<T, H, P, A>::load_factor() const BOOST_NOEXCEPT
|
||||
{
|
||||
if (table_.size_ == 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
BOOST_ASSERT(table_.bucket_count() != 0);
|
||||
return static_cast<float>(table_.size_) /
|
||||
static_cast<float>(table_.bucket_count());
|
||||
@@ -1986,6 +1990,10 @@ namespace boost {
|
||||
template <class T, class H, class P, class A>
|
||||
float unordered_multiset<T, H, P, A>::load_factor() const BOOST_NOEXCEPT
|
||||
{
|
||||
if (table_.size_ == 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
BOOST_ASSERT(table_.bucket_count() != 0);
|
||||
return static_cast<float>(table_.size_) /
|
||||
static_cast<float>(table_.bucket_count());
|
||||
|
Reference in New Issue
Block a user