summaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/string
diff options
context:
space:
mode:
authorarcadia-devtools <[email protected]>2022-04-03 13:57:21 +0300
committerarcadia-devtools <[email protected]>2022-04-03 13:57:21 +0300
commit07ff7621c09ff6414a48ec1757c72af1e5e1dbc0 (patch)
tree6700f4b0c2e985ad9b95399a22a70676bd2b9195 /contrib/libs/cxxsupp/libcxx/include/string
parentbb0d582a3fa3ddfc775c44fe32f24b6806606b7b (diff)
intermediate changes
ref:8fcd56b3fe762902848ae3f9eabb01e1aa97432c
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/string')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/string14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/string b/contrib/libs/cxxsupp/libcxx/include/string
index 870266c09a1..4103c59a5df 100644
--- a/contrib/libs/cxxsupp/libcxx/include/string
+++ b/contrib/libs/cxxsupp/libcxx/include/string
@@ -158,6 +158,9 @@ public:
void resize(size_type n, value_type c);
void resize(size_type n);
+ template<class Operation>
+ constexpr void resize_and_overwrite(size_type n, Operation op); // since C++23
+
void reserve(size_type res_arg);
void reserve(); // deprecated in C++20
void shrink_to_fit();
@@ -1004,6 +1007,17 @@ public:
_LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
void reserve(size_type __requested_capacity);
+
+#if _LIBCPP_STD_VER > 20
+ template <class _Op>
+ _LIBCPP_HIDE_FROM_ABI constexpr
+ void resize_and_overwrite(size_type __n, _Op __op) {
+ __resize_default_init(__n);
+ pointer __data = data();
+ __erase_to_end(_VSTD::move(__op)(__data, __n));
+ }
+#endif
+
_LIBCPP_INLINE_VISIBILITY void __resize_default_init(size_type __n);
_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY