|
Boost : |
Subject: Re: [boost] [MPL.Math] ratio
From: Cromwell Enage (sponage_at_[hidden])
Date: 2008-11-14 04:17:58
--- On Fri, 11/14/08, Cromwell Enage wrote:
> Sections: 20.4.1 [Class template ratio], 20.4.2 [Arithmetic
> on ratio types]
Also 20.4.3 [Comparison of ratio types]
[snip rest of report]
> We should also require that each of the arithmetic
> metafunctions inherit from std::ratio if we want to allow
> the following usage (note the change from R::type::num to
> R::num).
>
> template <typename R>
> struct absolute_ratio
> : boost::mpl::eval_if<
> R::num < 0
> , boost::mpl::negate<R>
> , R
> >
> {
> };
For the sake of completeness, if the arithmetic metafunctions are to inherit from std::ratio, so should the comparison metafunctions.
Cheers,
Cromwell D. Enage
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk