|
Boost : |
From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-04-27 06:30:48
Paul,
I have some C++ Builder specific fixes for rational.hpp, I've attached the
updated code to this mail, the specific fixes are:
in helper function gcd: for some reason this is getting instantiated with
const-qualified template args - ie as gcd<const int> - which prevents
compilation - I've added a Borland specific fix to the gcd implementation
using type-traits. If you wanted to you could make this the only version
and remove the conditional compiles - whatever is neater. BTW shouldn't
gcd either be in its own implementation namespace or moved out to
utility.hpp and documented - this seems like the kind of function that
several libraries might want to use.
In the friend function abs: bcb has problems with friend functions that
aren't implemented class-inline, likewise friend functions can't access the
class template parameters, but can access member typedefs. So either
IntType needs to be typedef'ed in the class declaration and the
implementation moved class inline, or abs can be implemented as a
non-friend non-member function, the latter is the approach I've taken here.
As before you may be able to avoid some of these conditional compiles, and
produce a compiler neutral version.
- John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk