]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/awaitable.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / asio / awaitable.hpp
index 6564cfd59dd2d96e690f6d1ff4d637d468b56492..7501989952c697c9dc0346cab9dd67d7ed842858 100644 (file)
@@ -2,7 +2,7 @@
 // awaitable.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)
@@ -25,6 +25,7 @@
 # include <experimental/coroutine>
 #endif // defined(BOOST_ASIO_HAS_STD_COROUTINE)
 
+#include <utility>
 #include <boost/asio/any_io_executor.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -48,7 +49,7 @@ template <typename, typename> class awaitable_frame;
 
 /// The return type of a coroutine or asynchronous operation.
 template <typename T, typename Executor = any_io_executor>
-class awaitable
+class BOOST_ASIO_NODISCARD awaitable
 {
 public:
   /// The type of the awaited value.
@@ -76,6 +77,14 @@ public:
       frame_->destroy();
   }
 
+  /// Move assignment.
+  awaitable& operator=(awaitable&& other) noexcept
+  {
+    if (this != &other)
+      frame_ = std::exchange(other.frame_, nullptr);
+    return *this;
+  }
+
   /// Checks if the awaitable refers to a future result.
   bool valid() const noexcept
   {