config/component: ENTT_IGNORE_IF_EMPTY -> ENTT_ETO_TYPE
This commit is contained in:
1
TODO
1
TODO
@@ -11,7 +11,6 @@ DOC:
|
||||
* examples (and credits) from @alanjfs :)
|
||||
|
||||
WIP:
|
||||
* make utilities page_size and in_place_delete public
|
||||
* emitter: runtime handlers, allocator support (ready for both already)
|
||||
* view/group: no storage_traits dependency -> use storage instead of components for the definition
|
||||
* basic_storage::bind for cross-registry setups
|
||||
|
||||
@@ -48,8 +48,10 @@
|
||||
# define ENTT_ASSERT(condition, ...) assert(condition)
|
||||
#endif
|
||||
|
||||
#ifndef ENTT_NO_ETO
|
||||
# define ENTT_IGNORE_IF_EMPTY
|
||||
#ifdef ENTT_NO_ETO
|
||||
# define ENTT_ETO_TYPE(Type) void
|
||||
#else
|
||||
# define ENTT_ETO_TYPE(Type) Type
|
||||
#endif
|
||||
|
||||
#ifdef ENTT_STANDARD_CPP
|
||||
|
||||
@@ -21,13 +21,8 @@ template<typename Type>
|
||||
struct in_place_delete<Type, std::enable_if_t<Type::in_place_delete>>
|
||||
: std::true_type {};
|
||||
|
||||
#if defined ENTT_IGNORE_IF_EMPTY
|
||||
template<typename Type, typename = void>
|
||||
struct page_size: std::integral_constant<std::size_t, !std::is_empty_v<Type> * ENTT_PACKED_PAGE> {};
|
||||
#else
|
||||
template<typename Type, typename = void>
|
||||
struct page_size: std::integral_constant<std::size_t, ENTT_PACKED_PAGE> {};
|
||||
#endif
|
||||
struct page_size: std::integral_constant<std::size_t, !std::is_empty_v<ENTT_ETO_TYPE(Type)> * ENTT_PACKED_PAGE> {};
|
||||
|
||||
template<typename Type>
|
||||
struct page_size<Type, std::enable_if_t<std::is_convertible_v<decltype(Type::page_size), std::size_t>>>
|
||||
|
||||
Reference in New Issue
Block a user