diff options
author | thegeorg <thegeorg@yandex-team.com> | 2022-08-21 01:48:26 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2022-08-21 01:48:26 +0300 |
commit | 6cc0b91261bafbdec4fee7207bae49b5dc6411d5 (patch) | |
tree | f8a99f0241697a99d4e5c214b86dc562833231e7 /util/generic/string_ut.h | |
parent | fd1dea8b14adddfe75164e3aef56bde0a12b9a43 (diff) | |
download | ydb-6cc0b91261bafbdec4fee7207bae49b5dc6411d5.tar.gz |
Switch TString and TStringBase to std::reverse_iterator
At the time an attempt to use e. g. `std::find_if` with `TString::rbegin()` / `TString::rend()` does not compile against `-DUSE_STL_SYSTEM` / modern libstdc++.
Diffstat (limited to 'util/generic/string_ut.h')
-rw-r--r-- | util/generic/string_ut.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/util/generic/string_ut.h b/util/generic/string_ut.h index 44bb10bdebe..3a91f61dd18 100644 --- a/util/generic/string_ut.h +++ b/util/generic/string_ut.h @@ -906,7 +906,7 @@ public: s2.assign(Data._0123456(), 2, 2); UNIT_ASSERT(s2 == Data._23()); - //s2.reserve(); + // s2.reserve(); TStringType s5(Data.abcde()); s5.clear(); @@ -1152,5 +1152,11 @@ public: *ritBegin = (ui8)'e'; UNIT_ASSERT_VALUES_EQUAL(*ritBegin, (ui8)'e'); + + str = chars; + auto it = std::find_if( + str.rbegin(), str.rend(), + [](char_type c) { return c == 'o'; }); + UNIT_ASSERT_EQUAL(it, str.rbegin()); } }; |