diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-01-31 17:22:33 +0300 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-01-31 17:22:33 +0300 |
commit | 52be5dbdd420165c68e7e90ba8f1d2f00da041f6 (patch) | |
tree | 5d47f5b2ff4e6a7c8e75d33931a1e683949b7229 /library/cpp/yt/misc/enum.h | |
parent | ea57c8867ceca391357c3c5ffcc5ba6738b49adc (diff) | |
parent | 809f0cf2fdfddfbeacc2256ffdbaaf5808ce5ed4 (diff) | |
download | ydb-52be5dbdd420165c68e7e90ba8f1d2f00da041f6.tar.gz |
Merge branch 'mergelibs12' into main
Diffstat (limited to 'library/cpp/yt/misc/enum.h')
-rw-r--r-- | library/cpp/yt/misc/enum.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/library/cpp/yt/misc/enum.h b/library/cpp/yt/misc/enum.h index 9da79b9fd3..954b63cbc0 100644 --- a/library/cpp/yt/misc/enum.h +++ b/library/cpp/yt/misc/enum.h @@ -185,52 +185,6 @@ struct TEnumTraits<T, true> //////////////////////////////////////////////////////////////////////////////// -// TODO(babenko): drop in favor of TEnumIndexedArray -//! A statically sized vector with elements of type |T| indexed by -//! the items of enumeration type |E|. -/*! - * Items are value-initialized on construction. - */ -template < - class E, - class T, - E Min = TEnumTraits<E>::GetMinValue(), - E Max = TEnumTraits<E>::GetMaxValue() -> -class TEnumIndexedVector -{ -public: - using TIndex = E; - using TValue = T; - - constexpr TEnumIndexedVector(); - constexpr TEnumIndexedVector(std::initializer_list<T> elements); - - constexpr TEnumIndexedVector(const TEnumIndexedVector&) = default; - constexpr TEnumIndexedVector(TEnumIndexedVector&&) noexcept = default; - - constexpr TEnumIndexedVector& operator=(const TEnumIndexedVector&) = default; - constexpr TEnumIndexedVector& operator=(TEnumIndexedVector&&) noexcept = default; - - T& operator[] (E index); - const T& operator[] (E index) const; - - // STL interop. - T* begin(); - const T* begin() const; - T* end(); - const T* end() const; - - static bool IsDomainValue(E value); - -private: - using TUnderlying = std::underlying_type_t<E>; - static constexpr int N = static_cast<TUnderlying>(Max) - static_cast<TUnderlying>(Min) + 1; - std::array<T, N> Items_; -}; - -//////////////////////////////////////////////////////////////////////////////// - //! Returns |true| iff the enumeration value is not bitwise zero. template <typename E> requires TEnumTraits<E>::IsBitEnum |