From cd9964944ed202f86c8aaef3f8135ba3dda70a11 Mon Sep 17 00:00:00 2001 From: Adam Emerson Date: Mon, 21 Aug 2023 17:28:05 -0400 Subject: [PATCH] neorados: Moved-from operations are equivalent to new Signed-off-by: Adam Emerson --- src/neorados/RADOS.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/neorados/RADOS.cc b/src/neorados/RADOS.cc index 91c55ba5f84..b8d2303a38d 100644 --- a/src/neorados/RADOS.cc +++ b/src/neorados/RADOS.cc @@ -369,10 +369,22 @@ struct OpImpl { OpImpl() = default; OpImpl(const OpImpl& rhs) = delete; - OpImpl(OpImpl&& rhs) = default; + OpImpl(OpImpl&& rhs) + : op(std::move(rhs.op)), mtime(std::move(rhs.mtime)) { + rhs.op = ObjectOperation{}; + rhs.mtime.reset(); + } OpImpl& operator =(const OpImpl& rhs) = delete; - OpImpl& operator =(OpImpl&& rhs) = default; + OpImpl& operator =(OpImpl&& rhs) { + op = std::move(rhs.op); + mtime = std::move(rhs.mtime); + + rhs.op = ObjectOperation{}; + rhs.mtime.reset(); + + return *this; + } }; Op::Op() { -- 2.47.3