Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.


// deferred_1.cpp
// ~~~~~~~~~~~~~~
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at

#include <boost/asio.hpp>
#include <iostream>

using boost::asio::deferred;

int main()
  boost::asio::io_context ctx;

  boost::asio::steady_timer timer(ctx);

  auto deferred_op = timer.async_wait(deferred);

      [](boost::system::error_code ec)
        std::cout << "timer wait finished: " << ec.message() << "\n";

  return 0;