Fix failures when used with an expression-template enabled number type such as the gmpxx clases. Add additional concept check for integer code using gmp classes. Fixes #4139.

[SVN r61837]
This commit is contained in:
John Maddock
2010-05-07 15:36:09 +00:00
committed by Peter Dimov
parent 7c528c325e
commit 5174291e08

View File

@ -78,8 +78,8 @@ namespace detail
RingType
gcd_euclidean
(
RingType a,
RingType b
RingType a,
RingType b
)
{
// Avoid repeated construction
@ -116,7 +116,7 @@ namespace detail
IntegerType const zero = static_cast<IntegerType>( 0 );
IntegerType const result = gcd_euclidean( a, b );
return ( result < zero ) ? -result : result;
return ( result < zero ) ? static_cast<IntegerType>(-result) : result;
}
// Greatest common divisor for unsigned binary integers
@ -212,7 +212,7 @@ namespace detail
IntegerType const zero = static_cast<IntegerType>( 0 );
IntegerType const result = lcm_euclidean( a, b );
return ( result < zero ) ? -result : result;
return ( result < zero ) ? static_cast<IntegerType>(-result) : result;
}
// Function objects to find the best way of computing GCD or LCM