Boost logo

Boost Users :

Subject: [Boost-users] [asio][chrono] using steady_timer portably
From: Igor R (boost.lists_at_[hidden])
Date: 2013-01-15 06:33:54


Hello,

There's some use of asio::steady_timer in my code (1.51):

asio::steady_timer timer_;
//.......
timer_.expires_from_now(boost::chrono::milliseconds(100));
//......

However, the above appears to be non-portable, as under c++11
steady_timer uses std::chrono, while boost::chrono doesn't seem to
"forward" its types to std::chrono.
I know I can use
asio::basic_waitable_timer<boost::chrono::steady_clock> explicitly,
but maybe there's some more straightforward solution (eg.
boost::chrono configuration)?

Thanks.


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