chriskohlhoff / asio

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

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

Open arbrsts opened 1 month ago

arbrsts commented 1 month 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;
  ``''''''`` }