chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.97k stars 1.22k forks source link

Include full snippet for main method for Timer.5 tutorial #1480

Open arbrsts opened 6 months ago

arbrsts commented 6 months ago

Added a full main method example snippet to the Timer.5 tutorial to ensure the source code can be replicated and compiled successfully like the other Boost Asio tutorial examples without having to reference the full source listing page.

  ``''''''``int main()
  ``''''''``{
  ``''''''``  asio::io_context io;
  ``''''''``  printer p(io);
  ``''''''``  std::thread t([&]{ io.run(); });
  ``''''''``  io.run();
  ``''''''``  t.join();
  ``''''''``  
  ``''''''``  return 0;
  ``''''''`` }