diff options
author | shakurov <shakurov@yandex-team.ru> | 2022-02-10 16:49:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:23 +0300 |
commit | 296627beeba9eb1fbc3cc1ff3dbae3ff192fb2a8 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/yt/string | |
parent | 6750fac04a33847862ab7bfb19145f6f91207be6 (diff) | |
download | ydb-296627beeba9eb1fbc3cc1ff3dbae3ff192fb2a8.tar.gz |
Restoring authorship annotation for <shakurov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yt/string')
-rw-r--r-- | library/cpp/yt/string/format-inl.h | 46 | ||||
-rw-r--r-- | library/cpp/yt/string/format.h | 26 |
2 files changed, 36 insertions, 36 deletions
diff --git a/library/cpp/yt/string/format-inl.h b/library/cpp/yt/string/format-inl.h index 87914932fb..5484d4a216 100644 --- a/library/cpp/yt/string/format-inl.h +++ b/library/cpp/yt/string/format-inl.h @@ -190,32 +190,32 @@ struct TValueFormatter<TEnum, typename std::enable_if<TEnumTraits<TEnum>::IsEnum }; template <class TRange, class TFormatter> -typename TFormattableView<TRange, TFormatter>::TBegin TFormattableView<TRange, TFormatter>::begin() const -{ - return RangeBegin; -} - -template <class TRange, class TFormatter> -typename TFormattableView<TRange, TFormatter>::TEnd TFormattableView<TRange, TFormatter>::end() const -{ - return RangeEnd; -} - -template <class TRange, class TFormatter> -TFormattableView<TRange, TFormatter> MakeFormattableView( +typename TFormattableView<TRange, TFormatter>::TBegin TFormattableView<TRange, TFormatter>::begin() const +{ + return RangeBegin; +} + +template <class TRange, class TFormatter> +typename TFormattableView<TRange, TFormatter>::TEnd TFormattableView<TRange, TFormatter>::end() const +{ + return RangeEnd; +} + +template <class TRange, class TFormatter> +TFormattableView<TRange, TFormatter> MakeFormattableView( const TRange& range, - TFormatter&& formatter) + TFormatter&& formatter) { - return TFormattableView<TRange, std::decay_t<TFormatter>>{range.begin(), range.end(), std::forward<TFormatter>(formatter)}; + return TFormattableView<TRange, std::decay_t<TFormatter>>{range.begin(), range.end(), std::forward<TFormatter>(formatter)}; } template <class TRange, class TFormatter> -TFormattableView<TRange, TFormatter> MakeShrunkFormattableView( +TFormattableView<TRange, TFormatter> MakeShrunkFormattableView( const TRange& range, - TFormatter&& formatter, + TFormatter&& formatter, size_t limit) { - return TFormattableView<TRange, std::decay_t<TFormatter>>{range.begin(), range.end(), std::forward<TFormatter>(formatter), limit}; + return TFormattableView<TRange, std::decay_t<TFormatter>>{range.begin(), range.end(), std::forward<TFormatter>(formatter), limit}; } template <class TRange, class TFormatter> @@ -258,13 +258,13 @@ void FormatKeyValueRange(TStringBuilderBase* builder, const TRange& range, const builder->AppendChar('}'); } -// TFormattableView +// TFormattableView template <class TRange, class TFormatter> -struct TValueFormatter<TFormattableView<TRange, TFormatter>> +struct TValueFormatter<TFormattableView<TRange, TFormatter>> { static void Do(TStringBuilderBase* builder, const TFormattableView<TRange, TFormatter>& range, TStringBuf /*format*/) { - FormatRange(builder, range, range.Formatter, range.Limit); + FormatRange(builder, range, range.Formatter, range.Limit); } }; @@ -337,9 +337,9 @@ struct TValueFormatter<std::multimap<K, V>> } }; -// THashSet +// THashSet template <class T> -struct TValueFormatter<THashSet<T>> +struct TValueFormatter<THashSet<T>> { static void Do(TStringBuilderBase* builder, const THashSet<T>& collection, TStringBuf /*format*/) { diff --git a/library/cpp/yt/string/format.h b/library/cpp/yt/string/format.h index 4f3f8a710a..9708fe5906 100644 --- a/library/cpp/yt/string/format.h +++ b/library/cpp/yt/string/format.h @@ -67,30 +67,30 @@ TString Format(TStringBuf format, TArgs&&... args); //////////////////////////////////////////////////////////////////////////////// template <class TRange, class TFormatter> -struct TFormattableView +struct TFormattableView { - using TBegin = std::decay_t<decltype(std::declval<const TRange>().begin())>; - using TEnd = std::decay_t<decltype(std::declval<const TRange>().end())>; - - TBegin RangeBegin; - TEnd RangeEnd; + using TBegin = std::decay_t<decltype(std::declval<const TRange>().begin())>; + using TEnd = std::decay_t<decltype(std::declval<const TRange>().end())>; + + TBegin RangeBegin; + TEnd RangeEnd; TFormatter Formatter; size_t Limit = std::numeric_limits<size_t>::max(); - - TBegin begin() const; - TEnd end() const; + + TBegin begin() const; + TEnd end() const; }; //! Annotates a given #range with #formatter to be applied to each item. template <class TRange, class TFormatter> -TFormattableView<TRange, TFormatter> MakeFormattableView( +TFormattableView<TRange, TFormatter> MakeFormattableView( const TRange& range, - TFormatter&& formatter); + TFormatter&& formatter); template <class TRange, class TFormatter> -TFormattableView<TRange, TFormatter> MakeShrunkFormattableView( +TFormattableView<TRange, TFormatter> MakeShrunkFormattableView( const TRange& range, - TFormatter&& formatter, + TFormatter&& formatter, size_t limit); //////////////////////////////////////////////////////////////////////////////// |