Boost logo

Boost :

Subject: Re: [boost] [chrono] Interoperability with ICL and common concepts
From: Howard Hinnant (howard.hinnant_at_[hidden])
Date: 2011-03-16 11:10:39


On Mar 16, 2011, at 10:47 AM, Joachim Faulhaber wrote:

>>>> D d2 = D(); // d2.count() zero-initialized - safety if you believe 0 is safe
>
> BTW, I don't care for safety here at all. From my point of view I need
> some minimal information from an unknown type T to be able to express
> basic things like
>
> 0 < 1
>
> where 0 and 1 are not available as literals or atomic expressions for T.

<nod> This is pretty much the rationale for duration_values<Rep>::zero(). There does not exist a duration_values<Rep>::one() mainly because the standardization of the <chrono> library was very difficult, with many interested parties, and one of the ways to get something like that done is to propose as little as possible. We didn't absolutely need one() to get timed sleeping and waiting going, and we had to keep the thread library as the main client of <chrono>, lest consensus would not have been achieved. Things like one() might be added via a future TR and/or standard.

I'm already warming up my favorite additions for <chrono>. :-)

http://home.roadrunner.com/~hinnant/duration_io/chrono_io.html
http://home.roadrunner.com/~hinnant/duration_io/chrono_util.html

-Howard


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk