
----- Original Message ----- From: "joel falcou" <joel.falcou@lri.fr> To: <boost-users@lists.boost.org> Sent: Sunday, June 20, 2010 1:58 PM Subject: Re: [Boost-users] [boost] [chrono] v0.4.1 + thread_clock implementation on Windows
vicente.botet wrote:
Joel, arithmetic and integral are not the same thing for me. I don't see how I can make ratio be a model of a MPL Integral constant as ratio is not integral, value_type can not be defined, there is no next, nor prior. Am I missing something?
I'm fully aware of that, I was more suggesting that, yes, mpl::plus and etc works on ratio.
Yes, this could be great. Are you suggesting to rename ration_plus to mpl::plus and require that the parameters are Rational Constants?
Let's call that a Rational Constant then ;)
What should be for you the requirements for a Rational Constant? Expression Type Complexity r::tag rational_c_tag Constant time. r::value_type A boost::rational<integral_type> type Constant time. r::num An integral constant expression Constant time. r::den An integral constant expression Constant time. r::type Rational Constant Constant time. r::value_type const c = r() Constant time. Expression Semantics r::tag r's tag type; n::tag::value is n's conversion rank. r::num The value of the numerator integral constant. r::den The value of the denominator integral constant. r::type is_equivalent<r::type,r>::value == true. r::value_type const c = r() c.numerator() * r::den == c.denominator() * r::num.
The alternative is to just rename ratio_plus to plus.
Boost.Chrono follows the C++0x namming. What would be the advantage of renaming it? Best, Vicente