I have an application that uses asio deadline timers. The rest of the application uses std::chrono
constructs for its time values, and it feels awkward to use boost::posix_time
for only the stuff that touches asio. I'd like to use std::chrono
throughout the application if I can, for consistency, readability, etc.
It seems to me that the answer would involve using the timer's template:
typedef boost::asio::basic_deadline_timer<std::chrono::system_clock::time_point>
my_deadline_timer_type;
my_deadline_timer_type a_timer(io_service);
Except this blows up badly at compile time...many lines of error, most of which are similar to this:
/opt/arm/include/boost/asio/deadline_timer_service.hpp:51:43: error: invalid use of incomplete type 'boost::asio::deadline_timer_service > >, boost::asio::time_traits > > > >::traits_type {aka struct boost::asio::time_traits > > >}'
So, it looks like I may need to create a new traits_type
and declare a deadline_timer_service
using it, but I'm not sure how/where. I have to believe this problem has been solved. I'm using g++ 4.7.3 with -std=c++11 on linux, cross-compiling to arm.