Boost logo

Boost Users :

From: Daryle Walker (darylew_at_[hidden])
Date: 2005-08-22 06:06:09

On 8/22/05 2:34 AM, "Daniel Krügler" <dsp_at_[hidden]> wrote:

> After a short view at the rational.hpp header I propose to perform the
> following changes:
> 1) As counterpart to the existing:
> bool operator!() const;
> one should definitly add:
> operator bool_replacement_type() const;
> with a proper (member function pointer) definition of bool_replacement_type.

I just sent a post suggesting that on the developer list. (I already filed
a bug about it a few weeks ago.)

> 2) The function template
> template <typename IntType>
> IntType lcm(IntType n, IntType m);
> should be defined as
> template <typename IntType>
> IntType lcm(IntType n, boost::call_traits<IntType>::param_type m);
> which makes sense in this case because m is not modified internally (in
> contrast to n)
[TRUNCATE refined rational I/O ideas]

Wouldn't that be giving away an implementation detail? I wonder if we could
use the gcd & lcm functions I defined in boost::math? (They were written
after boost::rational was.)

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

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at