Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2001-11-07 01:58:37


on 11/6/01 3:04 PM, Helmut at helmut.zeisel_at_[hidden] wrote:

> --- In boost_at_y..., "Moore, Paul" <paul.moore_at_a...> wrote:
>> --- excerpt from a mail that I didn't send to the list... ---
>>
>> I just looked again - there's going to be a clash, in that if a user includes
>> rational.hpp and the GCD header, they are going to get errors because both
>> libraries define boost::gcd.
>>
>> What to do? Move the gcd implementation in rational.hpp into boost::detail?
>> Give up and use the dlw_gcd version?
>
> Maybe one could move the version in dlw_gcd to namespace boost::math.

The latest version of dlw_gcd.zip does that, but it doesn't completely solve
the problem. The new GCD library is supposed to succeed all other versions
currently in Boost, so existing versions should be removed. If not, they
should go into a detail namespace.

The new library uses the function-template-calling-a-class-template model to
make extension to new types (if necessary) easier. However, if some code
continues to use a private GCD routine, that code never sees any
optimizations the new library may bring. The new library also centralizes
the code and maintenance.

(If Boost.Rational switches to the new GCD library, make sure to change the
Rational docs as appropriate [like the Performance section]. If it
switches, Paul doesn't have to answer questions about the GCD code; the
questions could come to me. BTW, the docs do warn that the GCD code may
move to a separate library.)

I forgot to mention this in the announcement of dlw_gcd.zip 11, but it also
now decides at compile-time which GCD algorithm to call, the one for signed
integers or the more general routine. The general routine is used by
default; previously, the signed integer version was always used.

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

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