title: boost::asio::deadline_timer with std::chrono time values
body: <p>I have an application that uses asio deadline timers. The rest of the application uses <code>std::chrono</code> constructs for its time values, and it feels awkward to use <code>boost::posix_time</code> for only the stuff that touches asio. I'd like to use <code>std::chrono</code> throughout the application if I can, for consistency, readability, etc.</p>
  
  <p>It seems to me that the answer would involve using the timer's template:</p>
  
  <pre><code>typedef boost::asio::basic_deadline_timer&lt;std::chrono::system_clock::time_point&gt;
      my_deadline_timer_type;
   my_deadline_timer_type a_timer(io_service); 
  </code></pre>
  
  <p>Except this blows up badly at compile time...many lines of error, most of which are similar to this: </p>
  
  <blockquote>
    <p>/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 > > >}'</p>
  </blockquote>
  
  <p>So, it looks like I may need to create a new <code>traits_type</code> and declare a <code>deadline_timer_service</code> 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.</p>