aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/maybe.h
diff options
context:
space:
mode:
authorhalyavin <halyavin@yandex-team.com>2022-08-05 13:16:26 +0300
committerhalyavin <halyavin@yandex-team.com>2022-08-05 13:16:26 +0300
commit68d8479d07e0b689ba126cf2c159ae7f11afb9cf (patch)
tree92289178ebded927b8369e4eb1c931be730c6333 /util/generic/maybe.h
parentf346528af256244b692e713a8b6891957ae58dc6 (diff)
downloadydb-68d8479d07e0b689ba126cf2c159ae7f11afb9cf.tar.gz
Mark clear and reset methods as reinitializing the object.
This means, that moved-from object can be safely used after the call of such method. This attribute is used by clang-tidy which checks that moved-from objects are not used unless a reinitialization method is called first.
Diffstat (limited to 'util/generic/maybe.h')
-rw-r--r--util/generic/maybe.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/generic/maybe.h b/util/generic/maybe.h
index 34d21aebcd..633eb1b843 100644
--- a/util/generic/maybe.h
+++ b/util/generic/maybe.h
@@ -6,6 +6,7 @@
#include "yexception.h"
#include <util/system/align.h>
+#include <util/system/compiler.h>
#include <util/stream/output.h>
#include <util/ysaveload.h>
@@ -284,7 +285,7 @@ public:
return *Data();
}
- void Clear() noexcept {
+ Y_REINITIALIZES_OBJECT void Clear() noexcept {
if (Defined()) {
this->Defined_ = false;
Data()->~T();