Struct component_traits
Synopsis
#include <src/entt/entity/component.hpp>
template<typename Type, typename = void>
struct component_traits
Description
Common way to access various properties of components.
- Template Parameters
Type
- Type of component.
Mentioned in
- Entity Component System / Component traits
- Entity Component System / In-place delete
- Entity Component System / Empty type optimization
- Frequently Asked Questions / How can I represent hierarchies with my components?
Source
Lines 42-50 in src/entt/entity/component.hpp.
template<typename Type, typename = void>
struct component_traits {
static_assert(std::is_same_v<std::decay_t<Type>, Type>, "Unsupported type");
/*! @brief Pointer stability, default is `false`. */
static constexpr bool in_place_delete = internal::in_place_delete<Type>::value;
/*! @brief Page size, default is `ENTT_PACKED_PAGE` for non-empty types. */
static constexpr std::size_t page_size = internal::page_size<Type>::value;
};