1#ifndef ENTT_ENTITY_COMPONENT_HPP
2#define ENTT_ENTITY_COMPONENT_HPP
6#include "../config/config.h"
14template<
typename Type,
typename =
void>
15struct in_place_delete: std::bool_constant<!(std::is_move_constructible_v<Type> && std::is_move_assignable_v<Type>)> {};
18struct in_place_delete<void>: std::false_type {};
20template<
typename Type>
21struct in_place_delete<Type, std::enable_if_t<Type::in_place_delete>>
24template<
typename Type,
typename =
void>
25struct page_size: std::integral_constant<std::size_t, !std::is_empty_v<ENTT_ETO_TYPE(Type)> * ENTT_PACKED_PAGE> {};
28struct page_size<void>: std::integral_constant<std::size_t, 0u> {};
30template<
typename Type>
31struct page_size<Type, std::void_t<decltype(Type::page_size)>>
32 : std::integral_constant<std::size_t, Type::page_size> {};
41template<
typename Type,
typename =
void>
43 static_assert(std::is_same_v<std::decay_t<Type>, Type>,
"Unsupported type");
51 static constexpr std::size_t
page_size = internal::page_size<Type>::value;
Common way to access various properties of components.
static constexpr std::size_t page_size
Page size, default is ENTT_PACKED_PAGE for non-empty types.
static constexpr bool in_place_delete
Pointer stability, default is false.