diff options
| author | babenko <[email protected]> | 2024-01-29 13:05:03 +0300 | 
|---|---|---|
| committer | Alexander Smirnov <[email protected]> | 2024-01-31 14:24:06 +0300 | 
| commit | 3cae04dfa7fb9b08b4204c3459fbe5394867e2a7 (patch) | |
| tree | 150165bacba842ec6464b3aada3e38bc2f5e793d /library/cpp/yt/misc/enum_indexed_array-inl.h | |
| parent | e930e1b57b89a44338092ca427e2a56d3e978b48 (diff) | |
Move enum_indexed_array from misc to containers
Diffstat (limited to 'library/cpp/yt/misc/enum_indexed_array-inl.h')
| -rw-r--r-- | library/cpp/yt/misc/enum_indexed_array-inl.h | 73 | 
1 files changed, 0 insertions, 73 deletions
diff --git a/library/cpp/yt/misc/enum_indexed_array-inl.h b/library/cpp/yt/misc/enum_indexed_array-inl.h deleted file mode 100644 index edda891683e..00000000000 --- a/library/cpp/yt/misc/enum_indexed_array-inl.h +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once -#ifndef ENUM_INDEXED_ARRAY_INL_H_ -#error "Direct inclusion of this file is not allowed, include enum.h" -// For the sake of sane code completion. -#include "enum_indexed_array.h" -#endif - -#include <library/cpp/yt/assert/assert.h> - -namespace NYT { - -//////////////////////////////////////////////////////////////////////////////// - -template <class E, class T, E Min, E Max> -TEnumIndexedArray<E, T, Min, Max>::TEnumIndexedArray(std::initializer_list<std::pair<E, T>> elements) -{ -    for (const auto& [index, value] : elements) { -        (*this)[index] = value; -    } -} - -template <class E, class T, E Min, E Max> -T& TEnumIndexedArray<E, T, Min, Max>::operator[] (E index) -{ -    YT_ASSERT(IsValidIndex(index)); -    return Items_[ToUnderlying(index) - ToUnderlying(Min)]; -} - -template <class E, class T, E Min, E Max> -const T& TEnumIndexedArray<E, T, Min, Max>::operator[] (E index) const -{ -    return const_cast<TEnumIndexedArray&>(*this)[index]; -} - -template <class E, class T, E Min, E Max> -T* TEnumIndexedArray<E, T, Min, Max>::begin() -{ -    return Items_.data(); -} - -template <class E, class T, E Min, E Max> -const T* TEnumIndexedArray<E, T, Min, Max>::begin() const -{ -    return Items_.data(); -} - -template <class E, class T, E Min, E Max> -T* TEnumIndexedArray<E, T, Min, Max>::end() -{ -    return begin() + Size; -} - -template <class E, class T, E Min, E Max> -const T* TEnumIndexedArray<E, T, Min, Max>::end() const -{ -    return begin() + Size; -} - -template <class E, class T, E Min, E Max> -constexpr size_t TEnumIndexedArray<E, T, Min, Max>::size() const -{ -    return Size; -} - -template <class E, class T, E Min, E Max> -bool TEnumIndexedArray<E, T, Min, Max>::IsValidIndex(E index) -{ -    return index >= Min && index <= Max; -} - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT  | 
