diff options
author | halyavin <halyavin@yandex-team.com> | 2022-08-05 13:16:26 +0300 |
---|---|---|
committer | halyavin <halyavin@yandex-team.com> | 2022-08-05 13:16:26 +0300 |
commit | 68d8479d07e0b689ba126cf2c159ae7f11afb9cf (patch) | |
tree | 92289178ebded927b8369e4eb1c931be730c6333 /util/generic/string.h | |
parent | f346528af256244b692e713a8b6891957ae58dc6 (diff) | |
download | ydb-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.h | 3 |
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 |