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 | 6750fac04a33847862ab7bfb19145f6f91207be6 (patch) | |
tree | 4ef07665d11f55d011c0cc9ea4b74d03390a5bdb /library/cpp/yt/string | |
parent | eb4b8b8ee0d18f168ae14f4d88a6efe2498e0f78 (diff) | |
download | ydb-6750fac04a33847862ab7bfb19145f6f91207be6.tar.gz |
Restoring authorship annotation for <shakurov@yandex-team.ru>. Commit 1 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 5484d4a216c..87914932fb7 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 9708fe5906a..4f3f8a710a4 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); //////////////////////////////////////////////////////////////////////////////// |