#ifndef ENTT_ENTITY_POLY_STORAGE_HPP #define ENTT_ENTITY_POLY_STORAGE_HPP #include #include #include "../core/type_info.hpp" #include "../core/type_traits.hpp" #include "../poly/poly.hpp" #include "fwd.hpp" namespace entt { /** * @brief Basic poly storage implementation. * @tparam Entity A valid entity type (see entt_traits for more details). */ template struct Storage: type_list { /** * @brief Concept definition. * @tparam Base Opaque base class from which to inherit. */ template struct type: Base { /** * @brief Returns a type info for the contained objects. * @return The type info for the contained objects. */ type_info value_type() const ENTT_NOEXCEPT { return poly_call<0>(*this); } }; /** * @brief Concept implementation. * @tparam Type Type for which to generate an implementation. */ template using impl = value_list<&type_id>; }; /** * @brief Defines the poly storage type associate with a given entity type. * @tparam Entity A valid entity type (see entt_traits for more details). */ template struct poly_storage_traits { /*! @brief Poly storage type for the given entity type. */ using storage_type = poly>; }; } #endif