diff options
author | kaa <kaa@yandex-team.ru> | 2022-02-10 16:49:28 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:28 +0300 |
commit | f49cf886c755668578b0214ab9eae8ecdc1395a8 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/string/split.h | |
parent | b99e8e1b6e3468f81111414c917adc2d334b2c3c (diff) | |
download | ydb-f49cf886c755668578b0214ab9eae8ecdc1395a8.tar.gz |
Restoring authorship annotation for <kaa@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string/split.h')
-rw-r--r-- | util/string/split.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/util/string/split.h b/util/string/split.h index 29fafd7890..bc46d9e64c 100644 --- a/util/string/split.h +++ b/util/string/split.h @@ -10,7 +10,7 @@ #include <util/generic/store_policy.h> #include <util/generic/strbuf.h> #include <util/generic/string.h> -#include <util/generic/typetraits.h> +#include <util/generic/typetraits.h> #include <util/generic/vector.h> #include <util/generic/ylimits.h> #include <util/system/compat.h> @@ -260,28 +260,28 @@ struct TSetDelimiter: private TFindFirstOf<const Char> { } }; -namespace NSplitTargetHasPushBack { +namespace NSplitTargetHasPushBack { Y_HAS_MEMBER(push_back, PushBack); -} - +} + template <class T, class = void> struct TConsumerBackInserter; - + template <class T> struct TConsumerBackInserter<T, std::enable_if_t<NSplitTargetHasPushBack::TClassHasPushBack<T>::value>> { static void DoInsert(T* C, const typename T::value_type& i) { - C->push_back(i); - } -}; - -template <class T> + C->push_back(i); + } +}; + +template <class T> struct TConsumerBackInserter<T, std::enable_if_t<!NSplitTargetHasPushBack::TClassHasPushBack<T>::value>> { static void DoInsert(T* C, const typename T::value_type& i) { - C->insert(C->end(), i); - } -}; - -template <class T> + C->insert(C->end(), i); + } +}; + +template <class T> struct TContainerConsumer { inline TContainerConsumer(T* c) noexcept : C(c) |