Re: [boost] [Fwd: Re: [date-time][threads] Integrating C++0x clocks, time points, and durations into Boost?]

[sorry for sending this twice Howard] Hi Howard, 2008/6/19 Howard Hinnant <hinnant@twcny.rr.com>:
No problem. I'm getting emails through sporadically too. On Jun 18, 2008, at 11:48 PM, Darren Garvey wrote:
Ok. I think in context it's perfectly clear then.
I did actually get that impression from the text, although I have to admit I miss-remembered one paragraph: If R1::num * R2::den < R2::num * R1::den, ratio_less derives from true_type,
Being really nit-picky: It makes no difference semantically, but I think the second and third sentences could possibly do with being the other way around (or thereabouts), since the third is more important than the second. Maybe C++ was making my brain expect the optional features in a feature-list to come after the non-optional ones? ;-)
I didn't know you could do that to check for overflow. I think I fixed it in my experimental implementation, using BOOST_MPL_ASSERT_MSG for some spiffy diagnostics.
I've attached a version of static_gcd which uses intmax_t, although I can't find the relevant bit of the Boost.Math test-suite to check it properly.
In general, N2615 is sprinkled liberally with "diagnostic required". Errors which can be detected at compile time
are actively sought out.
I think I've added the necessary diagnostics to the ratio class itself, but not to any of the operators yet <time passes> Ok, I've attached a 7-zipped version that does have the operators. I'm in unfamiliar territory here, so there's probably more that can be done to help with compile-time efficiency and whatnot. It also still needs some more tests on the checked_ops and the ratio operators but I've run out of time for now (and I'm sure you have a proper test-suite somewhere ;-). IIUC, I *think* that only leaves dealing with the conditionals related to the optional convenience SI typedefs. Hope that helps, Darren

(apologies for the multiple posts) There's at least one problem with the code I sent: the '>' comparisons on lines 82 and 94 of checked_ops.hpp should both be '>='. -- Darren
participants (3)
-
Darren Garvey
-
Darren Garvey
-
Howard Hinnant