From 2a2e240dee140bb01882302e0224cf26ae90ac1d Mon Sep 17 00:00:00 2001 From: Zifeng Deng Date: Mon, 8 Jan 2024 21:36:02 +0800 Subject: [PATCH] feat(lazy_io): detach io requires r-value --- include/co_context/detail/lazy_io_awaiter.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/co_context/detail/lazy_io_awaiter.hpp b/include/co_context/detail/lazy_io_awaiter.hpp index e1cbfb4..6c2c15f 100644 --- a/include/co_context/detail/lazy_io_awaiter.hpp +++ b/include/co_context/detail/lazy_io_awaiter.hpp @@ -50,7 +50,7 @@ class lazy_awaiter { /*NOLINT*/ int32_t await_resume() const noexcept { return result(); } - std::suspend_never detach() noexcept { + std::suspend_never detach() && noexcept { #if LIBURINGCXX_IS_KERNEL_REACH(5, 17) assert(!sqe->is_cqe_skip()); sqe->set_cqe_skip(); @@ -462,8 +462,8 @@ struct lazy_link_timeout using lazy_link_io::await_suspend; using lazy_link_io::await_resume; - std::suspend_never detach() noexcept { - this->last_io->detach(); + std::suspend_never detach() && noexcept { + std::move(*(this->last_io)).detach(); return {}; }