]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/post.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / asio / post.hpp
index 65e858fd889233194feed054570e092c80ff71be..4d5a668dc343af34fd5c1dc96a7c656f200496aa 100644 (file)
@@ -2,7 +2,7 @@
 // post.hpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2019 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 http://www.boost.org/LICENSE_1_0.txt)
@@ -32,6 +32,9 @@ namespace asio {
  * executor. The function object is queued for execution, and is never called
  * from the current thread prior to returning from <tt>post()</tt>.
  *
+ * The use of @c post(), rather than @ref defer(), indicates the caller's
+ * preference that the function object be eagerly queued for execution.
+ *
  * This function has the following effects:
  *
  * @li Constructs a function object handler of type @c Handler, initialized
@@ -50,8 +53,8 @@ namespace asio {
  *
  * @li Returns <tt>result.get()</tt>.
  */
-template <typename CompletionToken>
-BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
+template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
+BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
     BOOST_ASIO_MOVE_ARG(CompletionToken) token);
 
 /// Submits a completion token or function object for execution.
@@ -60,6 +63,9 @@ BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
  * The function object is queued for execution, and is never called from the
  * current thread prior to returning from <tt>post()</tt>.
  *
+ * The use of @c post(), rather than @ref defer(), indicates the caller's
+ * preference that the function object be eagerly queued for execution.
+ *
  * This function has the following effects:
  *
  * @li Constructs a function object handler of type @c Handler, initialized
@@ -84,18 +90,28 @@ BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
  *
  * @li Returns <tt>result.get()</tt>.
  */
-template <typename Executor, typename CompletionToken>
-BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
-    const Executor& ex, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
+template <typename Executor,
+    BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
+      BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
+BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
+    const Executor& ex,
+    BOOST_ASIO_MOVE_ARG(CompletionToken) token
+      BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
     typename enable_if<is_executor<Executor>::value>::type* = 0);
 
 /// Submits a completion token or function object for execution.
 /**
  * @returns <tt>post(ctx.get_executor(), forward<CompletionToken>(token))</tt>.
  */
-template <typename ExecutionContext, typename CompletionToken>
-BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
-    ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
+template <typename ExecutionContext,
+    BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
+      BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
+        typename ExecutionContext::executor_type)>
+BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
+    ExecutionContext& ctx,
+    BOOST_ASIO_MOVE_ARG(CompletionToken) token
+      BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(
+        typename ExecutionContext::executor_type),
     typename enable_if<is_convertible<
       ExecutionContext&, execution_context&>::value>::type* = 0);