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

@@ -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