#ifndef ENTT_ENTITY_COMPONENT_HPP #define ENTT_ENTITY_COMPONENT_HPP #include #include #include "../config/config.h" namespace entt { /** * @cond TURN_OFF_DOXYGEN * Internal details not to be documented. */ namespace internal { template struct in_place_delete: std::false_type {}; template struct in_place_delete> : std::true_type {}; template struct page_size: std::integral_constant) ? 0u : ENTT_PACKED_PAGE> {}; template struct page_size>> : std::integral_constant {}; } // namespace internal /** * Internal details not to be documented. * @endcond */ /** * @brief Common way to access various properties of components. * @tparam Type Type of component. */ template struct component_traits { static_assert(std::is_same_v, Type>, "Unsupported type"); /*! @brief Pointer stability, default is `false`. */ static constexpr bool in_place_delete = internal::in_place_delete::value; /*! @brief Page size, default is `ENTT_PACKED_PAGE` for non-empty types. */ static constexpr std::size_t page_size = internal::page_size::value; }; /** * @brief Helper variable template. * @tparam Type Type of component. */ template inline constexpr bool ignore_as_empty_v = (component_traits::page_size == 0u); } // namespace entt #endif