Add workaround for GCC-5.1.0 numeric_limits.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65883
This commit is contained in:
jzmaddock
2015-04-25 11:31:17 +01:00
parent 689e66d28d
commit 524414edba

View File

@@ -130,10 +130,12 @@ inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBit
for(unsigned j = 0; j < inner_limit; ++j)
{
BOOST_ASSERT(i+j < result.size());
#if (!defined(__GLIBCXX__) && !defined(__GLIBCPP__)) || !BOOST_WORKAROUND(BOOST_GCC_VERSION <= 50100)
BOOST_ASSERT(!std::numeric_limits<double_limb_type>::is_specialized
|| ((std::numeric_limits<double_limb_type>::max)() - carry
>
static_cast<double_limb_type>(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::max_limb_value) * static_cast<double_limb_type>(cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::max_limb_value)));
#endif
carry += static_cast<double_limb_type>(pa[i]) * static_cast<double_limb_type>(pb[j]);
BOOST_ASSERT(!std::numeric_limits<double_limb_type>::is_specialized || ((std::numeric_limits<double_limb_type>::max)() - carry >= pr[i+j]));
carry += pr[i + j];