forked from boostorg/unordered
Expand calls to load_factor implementation
This commit is contained in:
@ -2758,12 +2758,6 @@ struct table : boost::unordered::detail::functions<typename Types::hasher,
|
||||
return policy::to_bucket(bucket_count_, hash_value);
|
||||
}
|
||||
|
||||
float load_factor() const
|
||||
{
|
||||
BOOST_ASSERT(bucket_count_ != 0);
|
||||
return static_cast<float>(size_) / static_cast<float>(bucket_count_);
|
||||
}
|
||||
|
||||
std::size_t bucket_size(std::size_t index) const
|
||||
{
|
||||
node_pointer n = begin(index);
|
||||
|
@ -1716,7 +1716,9 @@ unordered_map<K, T, H, P, A>::bucket_size(size_type n) const
|
||||
template <class K, class T, class H, class P, class A>
|
||||
float unordered_map<K, T, H, P, A>::load_factor() const BOOST_NOEXCEPT
|
||||
{
|
||||
return table_.load_factor();
|
||||
BOOST_ASSERT(table_.bucket_count_ != 0);
|
||||
return static_cast<float>(table_.size_) /
|
||||
static_cast<float>(table_.bucket_count_);
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
@ -2129,7 +2131,9 @@ unordered_multimap<K, T, H, P, A>::bucket_size(size_type n) const
|
||||
template <class K, class T, class H, class P, class A>
|
||||
float unordered_multimap<K, T, H, P, A>::load_factor() const BOOST_NOEXCEPT
|
||||
{
|
||||
return table_.load_factor();
|
||||
BOOST_ASSERT(table_.bucket_count_ != 0);
|
||||
return static_cast<float>(table_.size_) /
|
||||
static_cast<float>(table_.bucket_count_);
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
|
@ -1352,7 +1352,9 @@ unordered_set<T, H, P, A>::bucket_size(size_type n) const
|
||||
template <class T, class H, class P, class A>
|
||||
float unordered_set<T, H, P, A>::load_factor() const BOOST_NOEXCEPT
|
||||
{
|
||||
return table_.load_factor();
|
||||
BOOST_ASSERT(table_.bucket_count_ != 0);
|
||||
return static_cast<float>(table_.size_) /
|
||||
static_cast<float>(table_.bucket_count_);
|
||||
}
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
@ -1732,7 +1734,9 @@ unordered_multiset<T, H, P, A>::bucket_size(size_type n) const
|
||||
template <class T, class H, class P, class A>
|
||||
float unordered_multiset<T, H, P, A>::load_factor() const BOOST_NOEXCEPT
|
||||
{
|
||||
return table_.load_factor();
|
||||
BOOST_ASSERT(table_.bucket_count_ != 0);
|
||||
return static_cast<float>(table_.size_) /
|
||||
static_cast<float>(table_.bucket_count_);
|
||||
}
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
|
Reference in New Issue
Block a user