|
Boost Users : |
Subject: Re: [Boost-users] [chron] time_point convertible?
From: Agustín K-ballo Bergé (kaballo86_at_[hidden])
Date: 2014-01-17 09:39:02
On 17/01/2014 09:32 a.m., Oliver Kowalke wrote:
> 2014/1/17 Bjorn Reese <breese_at_[hidden]
> <mailto:breese_at_[hidden]>>
>
> Do you have to use time_point, or will duration suffice?
>
>
> because the interface should be equivalent to std::thread API both,
> time_point and duration, are required
>
Your API exposes both time_point and duration, that doesn't mean you
have to use them internally. What (I think) Bjorn is pointing at is that
durations are clock agnostic, so you should build your internal
implementation using the most precise duration you are willing to
support instead of using a clock. You can then turn any time_point or
duration into the specific duration you deal with internally, right at
the outermost layer.
Vicente (author of Boost.Chrono) has already explained this on the
thread where he requests this functionality to be present. Refer to that
thread for more detail.
Regards,
-- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net