Expand calls to max_size implementation

This commit is contained in:
Daniel James
2017-04-23 10:09:18 +01:00
parent a41a0f3a06
commit 435b7450d4
3 changed files with 28 additions and 15 deletions

View File

@ -2776,17 +2776,6 @@ struct table : boost::unordered::detail::functions<typename Types::hasher,
////////////////////////////////////////////////////////////////////////
// Load methods
std::size_t max_size() const
{
using namespace std;
// size < mlf_ * count
return boost::unordered::detail::double_to_size(
ceil(static_cast<double>(mlf_) *
static_cast<double>(max_bucket_count()))) -
1;
}
void recalculate_max_load()
{
using namespace std;

View File

@ -1497,7 +1497,13 @@ unordered_map<K, T, H, P, A>& unordered_map<K, T, H, P, A>::operator=(
template <class K, class T, class H, class P, class A>
std::size_t unordered_map<K, T, H, P, A>::max_size() const BOOST_NOEXCEPT
{
return table_.max_size();
using namespace std;
// size <= mlf_ * count
return boost::unordered::detail::double_to_size(
ceil(static_cast<double>(table_.mlf_) *
static_cast<double>(table_.max_bucket_count()))) -
1;
}
// modifiers
@ -1931,7 +1937,13 @@ unordered_multimap<K, T, H, P, A>& unordered_multimap<K, T, H, P, A>::operator=(
template <class K, class T, class H, class P, class A>
std::size_t unordered_multimap<K, T, H, P, A>::max_size() const BOOST_NOEXCEPT
{
return table_.max_size();
using namespace std;
// size <= mlf_ * count
return boost::unordered::detail::double_to_size(
ceil(static_cast<double>(table_.mlf_) *
static_cast<double>(table_.max_bucket_count()))) -
1;
}
// modifiers

View File

@ -1193,7 +1193,13 @@ unordered_set<T, H, P, A>& unordered_set<T, H, P, A>::operator=(
template <class T, class H, class P, class A>
std::size_t unordered_set<T, H, P, A>::max_size() const BOOST_NOEXCEPT
{
return table_.max_size();
using namespace std;
// size < mlf_ * count
return boost::unordered::detail::double_to_size(
ceil(static_cast<double>(table_.mlf_) *
static_cast<double>(table_.max_bucket_count()))) -
1;
}
// modifiers
@ -1566,7 +1572,13 @@ unordered_multiset<T, H, P, A>& unordered_multiset<T, H, P, A>::operator=(
template <class T, class H, class P, class A>
std::size_t unordered_multiset<T, H, P, A>::max_size() const BOOST_NOEXCEPT
{
return table_.max_size();
using namespace std;
// size < mlf_ * count
return boost::unordered::detail::double_to_size(
ceil(static_cast<double>(table_.mlf_) *
static_cast<double>(table_.max_bucket_count()))) -
1;
}
// modifiers