summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorermolovd <[email protected]>2025-11-13 11:27:49 +0300
committerermolovd <[email protected]>2025-11-13 11:44:04 +0300
commit1d7bad217e8d1e2bef618ee434943872b87a2b3b (patch)
tree83de37f309d1a6dcca4311537fc60ae5d1b84d68 /util
parent7b74fa8fc7cc82d96a0cba57d21b772fd1400a0a (diff)
removing dangerous cast operator
commit_hash:44a5b05387723256ff3e098559780727e8b542e3
Diffstat (limited to 'util')
-rw-r--r--util/generic/string.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/util/generic/string.h b/util/generic/string.h
index bb8d51045f4..0a89ea34a81 100644
--- a/util/generic/string.h
+++ b/util/generic/string.h
@@ -902,10 +902,12 @@ public:
return this->ConstRef();
}
- template <typename T, typename = std::enable_if_t<std::is_same_v<T, TStringType>>>
- operator T&() & Y_LIFETIME_BOUND {
- return this->MutRef();
- }
+ /*
+ * We have operator casting TString to `const std::string&` but we explicitly don't support
+ * casting TString to `std::string&` since such casting requires detaching TString and therefore
+ * modifies TString object. Sometimes compiler might call `operator std::string&`
+ * implicitly and it might lead to problems. Check IGNIETFERRO-2155 for details.
+ */
/*
* Following overloads of "operator+" aim to choose the cheapest implementation depending on