diff options
Diffstat (limited to '3rdparty/asio/include/asio/coroutine.hpp')
-rw-r--r-- | 3rdparty/asio/include/asio/coroutine.hpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/3rdparty/asio/include/asio/coroutine.hpp b/3rdparty/asio/include/asio/coroutine.hpp index d4a03356d69..036e5148ad0 100644 --- a/3rdparty/asio/include/asio/coroutine.hpp +++ b/3rdparty/asio/include/asio/coroutine.hpp @@ -2,7 +2,7 @@ // coroutine.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2024 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) @@ -205,7 +205,7 @@ class coroutine_ref; * { * do * { - * socket_.reset(new tcp::socket(io_context_)); + * socket_.reset(new tcp::socket(my_context_)); * yield acceptor->async_accept(*socket_, *this); * fork server(*this)(); * } while (is_parent()); @@ -227,7 +227,7 @@ class coroutine_ref; * Note that @c fork doesn't do the actual forking by itself. It is the * application's responsibility to create a clone of the coroutine and call it. * The clone can be called immediately, as above, or scheduled for delayed - * execution using something like io_context::post(). + * execution using something like asio::post(). * * @par Alternate macro names * @@ -266,6 +266,7 @@ class coroutine_ref public: coroutine_ref(coroutine& c) : value_(c.value_), modified_(false) {} coroutine_ref(coroutine* c) : value_(c->value_), modified_(false) {} + coroutine_ref(const coroutine_ref&) = default; ~coroutine_ref() { if (!modified_) value_ = -1; } operator int() const { return value_; } int& operator=(int v) { modified_ = true; return value_ = v; } @@ -289,7 +290,7 @@ private: bail_out_of_coroutine: \ break; \ } \ - else case 0: + else /* fall-through */ case 0: #define ASIO_CORO_YIELD_IMPL(n) \ for (_coro_value = (n);;) \ @@ -301,12 +302,12 @@ private: else \ switch (_coro_value ? 0 : 1) \ for (;;) \ - case -1: if (_coro_value) \ + /* fall-through */ case -1: if (_coro_value) \ goto terminate_coroutine; \ else for (;;) \ - case 1: if (_coro_value) \ + /* fall-through */ case 1: if (_coro_value) \ goto bail_out_of_coroutine; \ - else case 0: + else /* fall-through */ case 0: #define ASIO_CORO_FORK_IMPL(n) \ for (_coro_value = -(n);; _coro_value = (n)) \ |