[Boost-bugs] [Boost C++ Libraries] #3713: no straightforward way to convert fractional number of seconds to time duration

Subject: [Boost-bugs] [Boost C++ Libraries] #3713: no straightforward way to convert fractional number of seconds to time duration
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-12-03 20:12:47


#3713: no straightforward way to convert fractional number of seconds to time
duration
--------------------------------------------------+-------------------------
 Reporter: Paul Pogonyshev <pogonyshev@…> | Owner: az_sw_dude
     Type: Feature Requests | Status: new
Milestone: Boost 1.42.0 | Component: date_time
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: |
--------------------------------------------------+-------------------------
 It should be possible to just build a time duration for given number of
 seconds for double or float parameters. Current best way suggested on IRC
 is 'milliseconds (1000 * num_seconds)', but it feels like doing extra
 unneeded work. Besides, this way I need to choose between
 milli/micro/nano weighing precision loss vs. potential overflow on 32-bit
 machines. Boost, knowing how many ticks are in a second, could do this
 better.

 What I'm actually trying to do is to call timed_wait() on a condition.
 Currently, I have to

     condition.timed_wait (lock, milliseconds (1000 * num_seconds));

 where as if double was implicitly convertible to time duration I could
 just

     condition.timed_wait (lock, num_seconds);

 which is cleaner and more explicit.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3713>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC