diff options
author | babenko <babenko@yandex-team.com> | 2023-08-19 10:27:17 +0300 |
---|---|---|
committer | babenko <babenko@yandex-team.com> | 2023-08-19 12:16:04 +0300 |
commit | 24a7c2b976da9a1b85a80266ac05b39757ec8629 (patch) | |
tree | 795ad7a0ad2d588515bd73acd090b964e0075420 | |
parent | 03a33873367161c1cd33401c8ad8da49349c4272 (diff) | |
download | ydb-24a7c2b976da9a1b85a80266ac05b39757ec8629.tar.gz |
YT-18571: Replace NYT::ToUnderlying with ::ToUnderlying from util/generic/cast.h
-rw-r--r-- | library/cpp/yt/misc/enum-inl.h | 9 | ||||
-rw-r--r-- | library/cpp/yt/misc/enum.h | 5 |
2 files changed, 2 insertions, 12 deletions
diff --git a/library/cpp/yt/misc/enum-inl.h b/library/cpp/yt/misc/enum-inl.h index c7e0abdab2..0fcce62067 100644 --- a/library/cpp/yt/misc/enum-inl.h +++ b/library/cpp/yt/misc/enum-inl.h @@ -8,6 +8,8 @@ #include <util/string/printf.h> #include <util/string/cast.h> +#include <util/generic/cast.h> + #include <algorithm> #include <stdexcept> @@ -402,13 +404,6 @@ bool TEnumIndexedVector<E, T, Min, Max>::IsDomainValue(E value) //////////////////////////////////////////////////////////////////////////////// template <typename E> - requires std::is_enum_v<E> -constexpr std::underlying_type_t<E> ToUnderlying(E value) noexcept -{ - return static_cast<std::underlying_type_t<E>>(value); -} - -template <typename E> requires TEnumTraits<E>::IsBitEnum constexpr bool Any(E value) noexcept { diff --git a/library/cpp/yt/misc/enum.h b/library/cpp/yt/misc/enum.h index b6e19b9ef8..a881f22941 100644 --- a/library/cpp/yt/misc/enum.h +++ b/library/cpp/yt/misc/enum.h @@ -228,11 +228,6 @@ private: //////////////////////////////////////////////////////////////////////////////// -//! Replace with |std::to_underlying| in C++23. -template <typename E> - requires std::is_enum_v<E> -constexpr std::underlying_type_t<E> ToUnderlying(E value) noexcept; - //! Returns |true| iff the enumeration value is not bitwise zero. template <typename E> requires TEnumTraits<E>::IsBitEnum |