Unordered: Fix gcc error + warning.

[SVN r73839]
This commit is contained in:
Daniel James
2011-08-17 07:43:43 +00:00
parent eb8b8295a1
commit ce779452ba
2 changed files with 9 additions and 3 deletions

View File

@ -129,7 +129,9 @@ namespace boost { namespace unordered { namespace detail {
// size < mlf_ * count
return double_to_size_t(ceil(
(double) this->mlf_ * this->max_bucket_count())) - 1;
static_cast<double>(this->mlf_) *
static_cast<double>(this->max_bucket_count())
)) - 1;
}
std::size_t calculate_max_load()
@ -138,7 +140,11 @@ namespace boost { namespace unordered { namespace detail {
// From 6.3.1/13:
// Only resize when size >= mlf_ * count
return double_to_size_t(ceil((double) mlf_ * this->bucket_count_));
return double_to_size_t(ceil(
static_cast<double>(this->mlf_) *
static_cast<double>(this->bucket_count_)
)) - 1;
}
void max_load_factor(float z)

View File

@ -455,7 +455,7 @@ void unordered_movable_test(X& x, Key& k, T& /* t */, Hash& hf, Pred& eq)
typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
#if !defined(BOOST_NO_RVALUE_REFERENCES)
X x1(rvalue_default<X>();
X x1(rvalue_default<X>());
X x2(boost::move(x1));
x1 = rvalue_default<X>();
x2 = boost::move(x1);