mirror of
https://github.com/boostorg/integer.git
synced 2025-07-30 04:37:13 +02:00
fix errors (from Daryle Walker)
[SVN r11935]
This commit is contained in:
@ -276,33 +276,33 @@ namespace detail
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Function objects to find the best way of computing GCD or LCM
|
// Function objects to find the best way of computing GCD or LCM
|
||||||
|
template < typename T, bool IsSpecialized, bool IsSigned >
|
||||||
|
struct gcd_optimal_evaluator_helper
|
||||||
|
{
|
||||||
|
T operator ()( T const &a, T const &b )
|
||||||
|
{
|
||||||
|
return gcd_euclidean( a, b );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template < typename T >
|
||||||
|
struct gcd_optimal_evaluator_helper< T, true, true >
|
||||||
|
{
|
||||||
|
T operator ()( T const &a, T const &b )
|
||||||
|
{
|
||||||
|
return gcd_integer( a, b );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template < typename T >
|
template < typename T >
|
||||||
struct gcd_optimal_evaluator
|
struct gcd_optimal_evaluator
|
||||||
{
|
{
|
||||||
template < bool IsSpecialized, bool IsSigned >
|
|
||||||
struct helper
|
|
||||||
{
|
|
||||||
T operator ()( T const &a, T const &b )
|
|
||||||
{
|
|
||||||
return gcd_euclidean( a, b );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template < >
|
|
||||||
struct helper< true, true >
|
|
||||||
{
|
|
||||||
T operator ()( T const &a, T const &b )
|
|
||||||
{
|
|
||||||
return gcd_integer( a, b );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
T operator ()( T const &a, T const &b )
|
T operator ()( T const &a, T const &b )
|
||||||
{
|
{
|
||||||
typedef ::std::numeric_limits<T> limits_type;
|
typedef ::std::numeric_limits<T> limits_type;
|
||||||
|
|
||||||
typedef helper<limits_type::is_specialized, limits_type::is_signed>
|
typedef gcd_optimal_evaluator_helper<T, limits_type::is_specialized,
|
||||||
helper_type;
|
limits_type::is_signed> helper_type;
|
||||||
|
|
||||||
helper_type solver;
|
helper_type solver;
|
||||||
|
|
||||||
@ -310,33 +310,33 @@ namespace detail
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template < typename T, bool IsSpecialized, bool IsSigned >
|
||||||
|
struct lcm_optimal_evaluator_helper
|
||||||
|
{
|
||||||
|
T operator ()( T const &a, T const &b )
|
||||||
|
{
|
||||||
|
return lcm_euclidean( a, b );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template < typename T >
|
||||||
|
struct lcm_optimal_evaluator_helper< T, true, true >
|
||||||
|
{
|
||||||
|
T operator ()( T const &a, T const &b )
|
||||||
|
{
|
||||||
|
return lcm_integer( a, b );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template < typename T >
|
template < typename T >
|
||||||
struct lcm_optimal_evaluator
|
struct lcm_optimal_evaluator
|
||||||
{
|
{
|
||||||
template < bool IsSpecialized, bool IsSigned >
|
|
||||||
struct helper
|
|
||||||
{
|
|
||||||
T operator ()( T const &a, T const &b )
|
|
||||||
{
|
|
||||||
return lcm_euclidean( a, b );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template < >
|
|
||||||
struct helper< true, true >
|
|
||||||
{
|
|
||||||
T operator ()( T const &a, T const &b )
|
|
||||||
{
|
|
||||||
return lcm_integer( a, b );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
T operator ()( T const &a, T const &b )
|
T operator ()( T const &a, T const &b )
|
||||||
{
|
{
|
||||||
typedef ::std::numeric_limits<T> limits_type;
|
typedef ::std::numeric_limits<T> limits_type;
|
||||||
|
|
||||||
typedef helper<limits_type::is_specialized, limits_type::is_signed>
|
typedef lcm_optimal_evaluator_helper<T, limits_type::is_specialized,
|
||||||
helper_type;
|
limits_type::is_signed> helper_type;
|
||||||
|
|
||||||
helper_type solver;
|
helper_type solver;
|
||||||
|
|
||||||
@ -347,6 +347,7 @@ namespace detail
|
|||||||
// Functions to find the GCD or LCM in the best way
|
// Functions to find the GCD or LCM in the best way
|
||||||
template < typename T >
|
template < typename T >
|
||||||
inline
|
inline
|
||||||
|
T
|
||||||
gcd_optimal
|
gcd_optimal
|
||||||
(
|
(
|
||||||
T const & a,
|
T const & a,
|
||||||
@ -360,6 +361,7 @@ namespace detail
|
|||||||
|
|
||||||
template < typename T >
|
template < typename T >
|
||||||
inline
|
inline
|
||||||
|
T
|
||||||
lcm_optimal
|
lcm_optimal
|
||||||
(
|
(
|
||||||
T const & a,
|
T const & a,
|
||||||
|
Reference in New Issue
Block a user