26 static_assert(std::is_enum_v<K>);
39 auto idx =
static_cast<std::underlying_type_t<K>
>(k);
40 assert(idx >= 0 && idx < int64_t(N));
42 m_map[idx] = std::move(v);
46 constexpr const V& operator[](K k)
const noexcept
48 auto idx =
static_cast<std::underlying_type_t<K>
>(k);
49 assert(idx >= 0 && idx < int64_t(N));
54 constexpr const V& operator[](int64_t idx)
const noexcept
56 assert(idx >= 0 && idx < int64_t(N));
61 constexpr K key(
const V& v)
const noexcept
63 for(std::size_t i = 0; i < N; i++)
67 return static_cast<K
>(i);
75 constexpr std::optional<K> find_key(
const V& v)
const noexcept
77 for(std::size_t i = 0; i < N; i++)
81 return static_cast<K
>(i);
90 assert(i >= 0 && i < int64_t(N));
91 return {
static_cast<K
>(i), m_map[i]};
94 [[nodiscard]]
constexpr std::size_t size()
const noexcept {
return N; }