Boost logo

Boost :

Subject: Re: [boost] [math][integer] Moving integer utilities out of the mathlib.
From: Peter Dimov (lists_at_[hidden])
Date: 2015-01-10 09:14:39


John Maddock wrote:
> This does look to me like a good idea, but to remain coherent, all of
> http://www.boost.org/doc/libs/1_57_0/libs/math/doc/html/gcd_lcm.html
> should move, which means:
>
> common_factor.hpp
> common_factor_rt.hpp
> common_factor_ct.hpp
>
> Plus docs and tests.

One problem I see here is that the compile-time templates derive from
mpl::integral_c, which means a dependency on MPL. I doubt that anyone is
actually using anything besides ::value, but in principle, the base class
can't be removed without potentially breaking code. So, to be on the safe
side, boost/math/common_factor_ct.hpp should probably contain

using boost::integer::static_gcd_type;

template < static_gcd_type Value1, static_gcd_type Value2 >
struct boost::math::static_gcd : public mpl::integral_c<static_gcd_type,
    boost::integer::static_gcd<Value1, Value2>::value>
{
};

And, for reasons well outlined in your other post, the boost/math headers
should remain in Math.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk