#pragma once #include "adminive/adapter.hpp" #include "magic_enum/magic_enum.hpp" #include #include #include #include namespace adminive { template requires std::is_enum_v struct Enum_Adapter { static std::vector values() { const auto source = magic_enum::enum_values(); return std::vector(source.begin(), source.end()); } static std::string_view name(Enum value) { return magic_enum::enum_name(value); } static std::optional cast(std::string_view value) { return magic_enum::enum_cast(value); } static std::optional cast(std::underlying_type_t value) { return magic_enum::enum_cast(value); } }; }