mark awaiters as non copyable (#1457)

This commit is contained in:
Martin Chang 2022-12-18 15:12:32 +08:00 committed by GitHub
parent 80ea3c4f30
commit 19f08786f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -14,6 +14,7 @@
#pragma once #pragma once
#include <drogon/utils/optional.h> #include <drogon/utils/optional.h>
#include <trantor/utils/NonCopyable.h>
#include <trantor/net/EventLoop.h> #include <trantor/net/EventLoop.h>
#include <trantor/utils/Logger.h> #include <trantor/utils/Logger.h>
#include <algorithm> #include <algorithm>
@ -478,7 +479,7 @@ struct AsyncTask
/// coroutines /// coroutines
// The user is responsible to fill in `await_suspend()` and constructors. // The user is responsible to fill in `await_suspend()` and constructors.
template <typename T = void> template <typename T = void>
struct CallbackAwaiter struct CallbackAwaiter : public trantor::NonCopyable
{ {
bool await_ready() noexcept bool await_ready() noexcept
{ {
@ -520,7 +521,7 @@ struct CallbackAwaiter
}; };
template <> template <>
struct CallbackAwaiter<void> struct CallbackAwaiter<void> : public trantor::NonCopyable
{ {
bool await_ready() noexcept bool await_ready() noexcept
{ {