diff options
author | rogday <rogday@yandex-team.com> | 2024-02-16 15:05:56 +0300 |
---|---|---|
committer | Innokentii Mokin <innokentii@ydb.tech> | 2024-02-16 18:35:26 +0000 |
commit | 02f99defd4e8bf43db4357866a3966febd0d01fd (patch) | |
tree | 74db10f2a6a422e3a54a1867ec01850c6ea3a3e8 | |
parent | cd424968b328386acdfc8b7fb88b8ecebc2ad28c (diff) | |
download | ydb-02f99defd4e8bf43db4357866a3966febd0d01fd.tar.gz |
,Speedup scheduling failures commit
62c4cf20966ac12ba500e1b7f7f048969a8aacca
-rw-r--r-- | library/cpp/yt/string/format-inl.h | 11 | ||||
-rw-r--r-- | library/cpp/yt/string/unittests/format_ut.cpp | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/library/cpp/yt/string/format-inl.h b/library/cpp/yt/string/format-inl.h index 85e82b473e..bee888b2f0 100644 --- a/library/cpp/yt/string/format-inl.h +++ b/library/cpp/yt/string/format-inl.h @@ -19,6 +19,7 @@ #include <cctype> #include <optional> +#include <span> namespace NYT { @@ -315,6 +316,16 @@ struct TValueFormatter<std::vector<T, TAllocator>> } }; +// std::span +template <class T, size_t Extent> +struct TValueFormatter<std::span<T, Extent>> +{ + static void Do(TStringBuilderBase* builder, const std::span<T, Extent>& collection, TStringBuf /*format*/) + { + FormatRange(builder, collection, TDefaultFormatter()); + } +}; + // TCompactVector template <class T, unsigned N> struct TValueFormatter<TCompactVector<T, N>> diff --git a/library/cpp/yt/string/unittests/format_ut.cpp b/library/cpp/yt/string/unittests/format_ut.cpp index 5bcc0b0c40..86c5b220ee 100644 --- a/library/cpp/yt/string/unittests/format_ut.cpp +++ b/library/cpp/yt/string/unittests/format_ut.cpp @@ -18,6 +18,7 @@ static_assert(TFormatTraits<void*>::HasCustomFormatValue); static_assert(TFormatTraits<const char*>::HasCustomFormatValue); static_assert(TFormatTraits<TStringBuf>::HasCustomFormatValue); static_assert(TFormatTraits<TString>::HasCustomFormatValue); +static_assert(TFormatTraits<std::span<int>>::HasCustomFormatValue); static_assert(TFormatTraits<std::vector<int>>::HasCustomFormatValue); // N.B. TCompactVector<int, 1> is not buildable on Windows |