#pragma once #include namespace floormat { struct object; } namespace floormat::entities { struct erased_accessor; template struct field_repr_ final { field_repr_(T x) : value{move(x)} {} field_repr_(const field_repr_& other) noexcept = default; field_repr_& operator=(T x) noexcept { value = 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_; bool inspect_object_subtype(object& x); template bool inspect_field(void* datum, const entities::erased_accessor& accessor, const ArrayView>& list, size_t label_width); template requires std::is_enum_v bool inspect_field(void* datum, const entities::erased_accessor& accessor, const ArrayView>& list, size_t label_width) { return inspect_field>>(datum, accessor, list, label_width); } } // namespace floormat::entities