
14 Nov
2008
14 Nov
'08
9:17 a.m.
--- 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