Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio][chrono] using steady_timer portably
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-01-16 15:04:03


Le 15/01/13 12:33, Igor R a écrit :
> 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,

Agreed. I think there is a problem on the ASIO interface for
steady_timer as it changes depending on the context.
> but maybe there's some more straightforward solution (eg.
> boost::chrono configuration)?
>
>
I don't understand what do you mean. Could you elaborate?

Best,
Vicente


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