diff options
author | grand <grand@yandex-team.ru> | 2022-02-10 16:50:07 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:07 +0300 |
commit | a0e29f0026d32a60a618a620f30035c264346175 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/string | |
parent | 7eb3862cccdb866e7e739123c8024ccec628bb62 (diff) | |
download | ydb-a0e29f0026d32a60a618a620f30035c264346175.tar.gz |
Restoring authorship annotation for <grand@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string')
-rw-r--r-- | util/string/join.h | 8 | ||||
-rw-r--r-- | util/string/join_ut.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/util/string/join.h b/util/string/join.h index 9d9479b1c2..b166fad1f3 100644 --- a/util/string/join.h +++ b/util/string/join.h @@ -173,7 +173,7 @@ inline TBasicString<TCharType> JoinSeq(std::basic_string_view<TCharType> delim, using std::end; return JoinRange(delim, begin(data), end(data)); } - + template <typename TCharType, typename TContainer> inline TBasicString<TCharType> JoinSeq(const TCharType* delim, const TContainer& data) { TBasicStringBuf<TCharType> delimBuf = delim; @@ -252,13 +252,13 @@ constexpr auto MakeRangeJoiner(TStringBuf delim, const std::initializer_list<TVa * If someone needs to join std::initializer_list<TString> -- it still works because of the TContainer template above. */ -template <typename T> +template <typename T> inline std::enable_if_t< !std::is_same<std::decay_t<T>, TString>::value && !std::is_same<std::decay_t<T>, const char*>::value, TString> JoinSeq(const TStringBuf delim, const std::initializer_list<T>& data) { - return JoinRange(delim, data.begin(), data.end()); -} + return JoinRange(delim, data.begin(), data.end()); +} inline TString JoinSeq(const TStringBuf delim, const std::initializer_list<TStringBuf>& data) { return JoinRange(delim, data.begin(), data.end()); diff --git a/util/string/join_ut.cpp b/util/string/join_ut.cpp index d69442d18b..3ed2b2459c 100644 --- a/util/string/join_ut.cpp +++ b/util/string/join_ut.cpp @@ -34,7 +34,7 @@ Y_UNIT_TEST_SUITE(JoinStringTest) { UNIT_ASSERT_EQUAL(JoinRange(" ", v, v + 2), "1 2"); UNIT_ASSERT_EQUAL(JoinSeq(" ", {}), ""); UNIT_ASSERT_EQUAL(JoinSeq(" ", {42}), "42"); - UNIT_ASSERT_EQUAL(JoinSeq(" ", {1, 2, 3}), "1 2 3"); + UNIT_ASSERT_EQUAL(JoinSeq(" ", {1, 2, 3}), "1 2 3"); UNIT_ASSERT_VALUES_EQUAL(JoinSeq(" ", v), "1 2 3"); } |