#pragma once #include "enum-bitset-fwd.hpp" #include // todo replace it namespace floormat { template requires (std::is_enum_v && std::is_same_v>>) struct enum_bitset : std::bitset { using enum_type = Enum; using value_type = std::underlying_type_t; static constexpr auto COUNT = size_t{value_type(COUNT_)}; using std::bitset::bitset; constexpr bool operator[](Enum x) const { return std::bitset::operator[](size_t{value_type(x)}); } constexpr decltype(auto) operator[](Enum x) { return std::bitset::operator[](size_t{value_type(x)}); } }; } // namespace floormat