]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/windows/overlapped_ptr.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / asio / windows / overlapped_ptr.hpp
index 8c95ce45f9af8a8bed7a766c08601bf1c6fed754..a891248ceb06dba2c0e77ccbce14992464fb752b 100644 (file)
@@ -2,7 +2,7 @@
 // windows/overlapped_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2018 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)
@@ -50,10 +50,24 @@ public:
   }
 
   /// Construct an overlapped_ptr to contain the specified handler.
-  template <typename Handler>
-  explicit overlapped_ptr(boost::asio::io_context& io_context,
-      BOOST_ASIO_MOVE_ARG(Handler) handler)
-    : impl_(io_context, BOOST_ASIO_MOVE_CAST(Handler)(handler))
+  template <typename ExecutionContext, typename Handler>
+  explicit overlapped_ptr(ExecutionContext& context,
+      BOOST_ASIO_MOVE_ARG(Handler) handler,
+      typename enable_if<
+        is_convertible<ExecutionContext&, execution_context&>::value
+      >::type* = 0)
+    : impl_(context.get_executor(), BOOST_ASIO_MOVE_CAST(Handler)(handler))
+  {
+  }
+
+  /// Construct an overlapped_ptr to contain the specified handler.
+  template <typename Executor, typename Handler>
+  explicit overlapped_ptr(const Executor& ex,
+      BOOST_ASIO_MOVE_ARG(Handler) handler,
+      typename enable_if<
+        is_executor<Executor>::value
+      >::type* = 0)
+    : impl_(ex, BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 
@@ -70,11 +84,24 @@ public:
 
   /// Reset to contain the specified handler, freeing any current OVERLAPPED
   /// object.
-  template <typename Handler>
-  void reset(boost::asio::io_context& io_context,
-      BOOST_ASIO_MOVE_ARG(Handler) handler)
+  template <typename ExecutionContext, typename Handler>
+  void reset(ExecutionContext& context, BOOST_ASIO_MOVE_ARG(Handler) handler,
+      typename enable_if<
+        is_convertible<ExecutionContext&, execution_context&>::value
+      >::type* = 0)
+  {
+    impl_.reset(context.get_executor(), BOOST_ASIO_MOVE_CAST(Handler)(handler));
+  }
+
+  /// Reset to contain the specified handler, freeing any current OVERLAPPED
+  /// object.
+  template <typename Executor, typename Handler>
+  void reset(const Executor& ex, BOOST_ASIO_MOVE_ARG(Handler) handler,
+      typename enable_if<
+        is_executor<Executor>::value
+      >::type* = 0)
   {
-    impl_.reset(io_context, BOOST_ASIO_MOVE_CAST(Handler)(handler));
+    impl_.reset(ex, BOOST_ASIO_MOVE_CAST(Handler)(handler));
   }
 
   /// Get the contained OVERLAPPED object.