diff options
| author | arkady-e1ppa <[email protected]> | 2024-06-11 22:01:04 +0300 |
|---|---|---|
| committer | arkady-e1ppa <[email protected]> | 2024-06-12 11:47:00 +0300 |
| commit | 89f56e044a4f82c7e88fa15771beca2d5787c7c8 (patch) | |
| tree | adb31c52e55de4c2131cf15ca722e64b609b1a10 /library/cpp/yt/misc | |
| parent | a41bb65a80fdc183e427b6c337dbbc15776f1c92 (diff) | |
YT-21868: Delete unneeded ToString methods
e856aa45df227b86e8b121852d3774bb2504193b
Diffstat (limited to 'library/cpp/yt/misc')
| -rw-r--r-- | library/cpp/yt/misc/optional.h | 6 | ||||
| -rw-r--r-- | library/cpp/yt/misc/source_location.cpp | 7 | ||||
| -rw-r--r-- | library/cpp/yt/misc/source_location.h | 3 | ||||
| -rw-r--r-- | library/cpp/yt/misc/strong_typedef.h | 7 | ||||
| -rw-r--r-- | library/cpp/yt/misc/variant-inl.h | 6 | ||||
| -rw-r--r-- | library/cpp/yt/misc/variant.cpp | 2 | ||||
| -rw-r--r-- | library/cpp/yt/misc/variant.h | 5 |
7 files changed, 4 insertions, 32 deletions
diff --git a/library/cpp/yt/misc/optional.h b/library/cpp/yt/misc/optional.h index d5e3c07fbe0..c5982af7bfc 100644 --- a/library/cpp/yt/misc/optional.h +++ b/library/cpp/yt/misc/optional.h @@ -97,12 +97,6 @@ struct TStdOptionalTraits<std::optional<T>> } // namespace NYT template <class T> -TString ToString(const std::optional<T>& nullable) -{ - return nullable ? ToString(*nullable) : "<Null>"; -} - -template <class T> struct THash<std::optional<T>> { size_t operator()(const std::optional<T>& nullable) const diff --git a/library/cpp/yt/misc/source_location.cpp b/library/cpp/yt/misc/source_location.cpp index 3fe45e23a76..37eb5edd533 100644 --- a/library/cpp/yt/misc/source_location.cpp +++ b/library/cpp/yt/misc/source_location.cpp @@ -10,7 +10,7 @@ namespace NYT { #ifdef __cpp_lib_source_location -void FormatValue(TStringBuilderBase* builder, const std::source_location& location, TStringBuf /*format*/) +void FormatValue(TStringBuilderBase* builder, const std::source_location& location, TStringBuf /*spec*/) { if (location.file_name() != nullptr) { builder->AppendFormat( @@ -23,11 +23,6 @@ void FormatValue(TStringBuilderBase* builder, const std::source_location& locati } } -TString ToString(const std::source_location& location) -{ - return ToStringViaBuilder(location); -} - #endif // __cpp_lib_source_location //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/yt/misc/source_location.h b/library/cpp/yt/misc/source_location.h index 38a6f83c804..43b2b86fcdd 100644 --- a/library/cpp/yt/misc/source_location.h +++ b/library/cpp/yt/misc/source_location.h @@ -15,8 +15,7 @@ namespace NYT { class TStringBuilderBase; -void FormatValue(TStringBuilderBase* builder, const std::source_location& location, TStringBuf /*format*/); -TString ToString(const std::source_location& location); +void FormatValue(TStringBuilderBase* builder, const std::source_location& location, TStringBuf /*spec*/); #endif // __cpp_lib_source_location diff --git a/library/cpp/yt/misc/strong_typedef.h b/library/cpp/yt/misc/strong_typedef.h index d47581701d6..58d96ebd2cf 100644 --- a/library/cpp/yt/misc/strong_typedef.h +++ b/library/cpp/yt/misc/strong_typedef.h @@ -56,13 +56,6 @@ public: private: T Underlying_; - - //! NB: Hidden friend definition to make this name accessible only via ADL. - friend TString ToString(const TStrongTypedef& value) - requires requires (T value) { { ToString(value) } -> std::same_as<TString>; } - { - return ToString(value.Underlying_); - } }; #define YT_DEFINE_STRONG_TYPEDEF(T, TUnderlying) \ diff --git a/library/cpp/yt/misc/variant-inl.h b/library/cpp/yt/misc/variant-inl.h index 01f0e08593a..4b0e04c92c7 100644 --- a/library/cpp/yt/misc/variant-inl.h +++ b/library/cpp/yt/misc/variant-inl.h @@ -45,12 +45,6 @@ void FormatValue(TStringBuilderBase* builder, const std::variant<Ts...>& variant NDetail::TVariantFormatter<0, Ts...>::Do(builder, variant, spec); } -template <class... Ts> -TString ToString(const std::variant<Ts...>& variant) -{ - return ToStringViaBuilder(variant); -} - //////////////////////////////////////////////////////////////////////////////// } // namespace NYT diff --git a/library/cpp/yt/misc/variant.cpp b/library/cpp/yt/misc/variant.cpp index be86affef8f..df78563d0c9 100644 --- a/library/cpp/yt/misc/variant.cpp +++ b/library/cpp/yt/misc/variant.cpp @@ -6,7 +6,7 @@ namespace NYT { //////////////////////////////////////////////////////////////////////////////// -void FormatValue(TStringBuilderBase* builder, const std::monostate&, TStringBuf /*format*/) +void FormatValue(TStringBuilderBase* builder, const std::monostate&, TStringBuf /*spec*/) { builder->AppendString(TStringBuf("<monostate>")); } diff --git a/library/cpp/yt/misc/variant.h b/library/cpp/yt/misc/variant.h index 4ca977873e7..9e8e1220897 100644 --- a/library/cpp/yt/misc/variant.h +++ b/library/cpp/yt/misc/variant.h @@ -12,10 +12,7 @@ class TStringBuilderBase; template <class... Ts> void FormatValue(TStringBuilderBase* builder, const std::variant<Ts...>& variant, TStringBuf spec); -void FormatValue(TStringBuilderBase* builder, const std::monostate&, TStringBuf /*format*/); - -template <class... Ts> -TString ToString(const std::variant<Ts...>& variant); +void FormatValue(TStringBuilderBase* builder, const std::monostate&, TStringBuf /*spec*/); //////////////////////////////////////////////////////////////////////////////// |
