aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/string.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/string.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/string.h')
-rw-r--r--util/generic/string.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/generic/string.h b/util/generic/string.h
index fedde9e787..5f56954481 100644
--- a/util/generic/string.h
+++ b/util/generic/string.h
@@ -8,6 +8,7 @@
#include <string>
#include <string_view>
+#include <util/system/compiler.h>
#include <util/system/yassert.h>
#include "ptr.h"
@@ -561,7 +562,7 @@ private:
}
public:
- inline void clear() noexcept {
+ Y_REINITIALIZES_OBJECT inline void clear() noexcept {
#ifdef TSTRING_IS_STD_STRING
Storage_.clear();
#else