]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/test/archetypes/async_result.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / asio / test / archetypes / async_result.hpp
index a75d2f842f0a9af13f82d5b719b0b1737b5d9e83..8cb177184137bd6ca4d85c02d7915a9f1ffd3bff 100644 (file)
@@ -2,7 +2,7 @@
 // async_result.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2017 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)
@@ -12,7 +12,6 @@
 #define ARCHETYPES_ASYNC_RESULT_HPP
 
 #include <boost/asio/async_result.hpp>
-#include <boost/asio/handler_type.hpp>
 
 namespace archetypes {
 
@@ -35,6 +34,12 @@ struct concrete_handler
   void operator()(Arg1, Arg2)
   {
   }
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+  concrete_handler(concrete_handler&&) {}
+private:
+  concrete_handler(const concrete_handler&);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
 };
 
 } // namespace archetypes
@@ -43,28 +48,30 @@ namespace boost {
 namespace asio {
 
 template <typename Signature>
-struct handler_type<archetypes::lazy_handler, Signature>
-{
-  typedef archetypes::concrete_handler type;
-};
-
-template <>
-class async_result<archetypes::concrete_handler>
+class async_result<archetypes::lazy_handler, Signature>
 {
 public:
+  // The concrete completion handler type.
+  typedef archetypes::concrete_handler completion_handler_type;
+
   // The return type of the initiating function.
-  typedef int type;
+  typedef int return_type;
 
   // Construct an async_result from a given handler.
-  explicit async_result(archetypes::concrete_handler&)
+  explicit async_result(completion_handler_type&)
   {
   }
 
   // Obtain the value to be returned from the initiating function.
-  type get()
+  return_type get()
   {
     return 42;
   }
+
+private:
+  // Disallow copying and assignment.
+  async_result(const async_result&) BOOST_ASIO_DELETED;
+  async_result& operator=(const async_result&) BOOST_ASIO_DELETED;
 };
 
 } // namespace asio