aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorswarmer <swarmer@yandex-team.com>2024-09-28 20:59:28 +0300
committerswarmer <swarmer@yandex-team.com>2024-09-28 21:10:26 +0300
commitcd06c7f25fcb2ed1193f6f2b645c4e98ccedb03c (patch)
tree44a839c38d863fb12e7bffa7995def45fc8349f0
parent1c97858dd693c8a6831d065ead236fe9ae8fd791 (diff)
downloadydb-cd06c7f25fcb2ed1193f6f2b645c4e98ccedb03c.tar.gz
check lifetime bound of TString cast and Detach operators
commit_hash:43fb3eff8779379efe5955f3f48cef3bf8e3a894
-rw-r--r--util/generic/string.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/generic/string.h b/util/generic/string.h
index 0a75732eee..5fe507200d 100644
--- a/util/generic/string.h
+++ b/util/generic/string.h
@@ -346,7 +346,7 @@ public:
#endif
}
- TCharType* Detach() {
+ TCharType* Detach() Y_LIFETIME_BOUND {
#ifdef TSTRING_IS_STD_STRING
return Storage_.data();
#else
@@ -857,12 +857,12 @@ public:
return *this;
}
- operator const TStringType&() const noexcept {
+ operator const TStringType&() const noexcept Y_LIFETIME_BOUND {
return this->ConstRef();
}
template <typename T, typename = std::enable_if_t<std::is_same_v<T, TStringType>>>
- operator T&() & {
+ operator T&() & Y_LIFETIME_BOUND {
return this->MutRef();
}