]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/impl/post.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / asio / impl / post.hpp
index 7b3ec9324890621af919528dd30369f8448d387f..8c4a0baad689e14c0a8c63fc3cc67bef95c17ba6 100644 (file)
@@ -2,7 +2,7 @@
 // impl/post.hpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 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)
@@ -57,7 +57,8 @@ public:
           boost::asio::require(ex, execution::blocking.never),
           execution::relationship.fork,
           execution::allocator(alloc)),
-        BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+        boost::asio::detail::bind_handler(
+          BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)));
   }
 
   template <typename CompletionHandler>
@@ -78,7 +79,8 @@ public:
     typename associated_allocator<handler_t>::type alloc(
         (get_associated_allocator)(handler));
 
-    ex.post(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler), alloc);
+    ex.post(boost::asio::detail::bind_handler(
+          BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
   }
 };
 
@@ -104,7 +106,8 @@ public:
         execution::is_executor<
           typename conditional<true, executor_type, CompletionHandler>::type
         >::value
-        &&
+      >::type* = 0,
+      typename enable_if<
         !detail::is_work_dispatcher_required<
           typename decay<CompletionHandler>::type,
           Executor
@@ -121,7 +124,8 @@ public:
           boost::asio::require(ex_, execution::blocking.never),
           execution::relationship.fork,
           execution::allocator(alloc)),
-        BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+        boost::asio::detail::bind_handler(
+          BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)));
   }
 
   template <typename CompletionHandler>
@@ -130,7 +134,8 @@ public:
         execution::is_executor<
           typename conditional<true, executor_type, CompletionHandler>::type
         >::value
-        &&
+      >::type* = 0,
+      typename enable_if<
         detail::is_work_dispatcher_required<
           typename decay<CompletionHandler>::type,
           Executor
@@ -161,7 +166,8 @@ public:
         !execution::is_executor<
           typename conditional<true, executor_type, CompletionHandler>::type
         >::value
-        &&
+      >::type* = 0,
+      typename enable_if<
         !detail::is_work_dispatcher_required<
           typename decay<CompletionHandler>::type,
           Executor
@@ -173,7 +179,8 @@ public:
     typename associated_allocator<handler_t>::type alloc(
         (get_associated_allocator)(handler));
 
-    ex_.post(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler), alloc);
+    ex_.post(boost::asio::detail::bind_handler(
+          BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
   }
 
   template <typename CompletionHandler>
@@ -182,7 +189,8 @@ public:
         !execution::is_executor<
           typename conditional<true, executor_type, CompletionHandler>::type
         >::value
-        &&
+      >::type* = 0,
+      typename enable_if<
         detail::is_work_dispatcher_required<
           typename decay<CompletionHandler>::type,
           Executor
@@ -209,34 +217,34 @@ private:
 
 } // namespace detail
 
-template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
-    BOOST_ASIO_MOVE_ARG(CompletionToken) token)
+template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken>
+BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(NullaryToken, void()) post(
+    BOOST_ASIO_MOVE_ARG(NullaryToken) token)
 {
-  return async_initiate<CompletionToken, void()>(
+  return async_initiate<NullaryToken, void()>(
       detail::initiate_post(), token);
 }
 
 template <typename Executor,
-    BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
-    const Executor& ex, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
-    typename enable_if<
+    BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken>
+BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(NullaryToken, void()) post(
+    const Executor& ex, BOOST_ASIO_MOVE_ARG(NullaryToken) token,
+    typename constraint<
       execution::is_executor<Executor>::value || is_executor<Executor>::value
-    >::type*)
+    >::type)
 {
-  return async_initiate<CompletionToken, void()>(
+  return async_initiate<NullaryToken, void()>(
       detail::initiate_post_with_executor<Executor>(ex), token);
 }
 
 template <typename ExecutionContext,
-    BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
-inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
-    ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
-    typename enable_if<is_convertible<
-      ExecutionContext&, execution_context&>::value>::type*)
+    BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken>
+inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(NullaryToken, void()) post(
+    ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(NullaryToken) token,
+    typename constraint<is_convertible<
+      ExecutionContext&, execution_context&>::value>::type)
 {
-  return async_initiate<CompletionToken, void()>(
+  return async_initiate<NullaryToken, void()>(
       detail::initiate_post_with_executor<
         typename ExecutionContext::executor_type>(
           ctx.get_executor()), token);