#pragma once #include namespace floormat::entities { struct erased_accessor; template struct field_repr_ final { field_repr_(T x) : value{std::move(x)} {} field_repr_(const field_repr_& other) noexcept = default; field_repr_& operator=(T x) noexcept { value = std::move(x); return *this; } field_repr_& operator=(const field_repr_& x) noexcept = default; field_repr_& operator*() const noexcept { return value; } operator T() const noexcept { return value; } using Type = T; static constexpr Enum Repr = As; private: T value; }; enum class field_repr : unsigned char { input, slider, drag, cbx, }; template using field_repr_input = field_repr_; template using field_repr_slider = field_repr_; template using field_repr_drag = field_repr_; template using field_repr_cbx = field_repr_; template bool inspect_field(void* datum, const entities::erased_accessor& accessor, const ArrayView>& list); template bool inspect_type(T& x); template requires std::is_enum_v bool inspect_field(void* datum, const entities::erased_accessor& accessor, const ArrayView>& list) { return inspect_field>>(datum, accessor, list); } } // namespace floormat::entities