|
@@ -234,10 +234,9 @@ template<typename Entity, typename Type, typename Allocator, typename>
|
|
|
class basic_storage: public basic_sparse_set<Entity, typename std::allocator_traits<Allocator>::template rebind_alloc<Entity>> {
|
|
class basic_storage: public basic_sparse_set<Entity, typename std::allocator_traits<Allocator>::template rebind_alloc<Entity>> {
|
|
|
using alloc_traits = std::allocator_traits<Allocator>;
|
|
using alloc_traits = std::allocator_traits<Allocator>;
|
|
|
static_assert(std::is_same_v<typename alloc_traits::value_type, Type>);
|
|
static_assert(std::is_same_v<typename alloc_traits::value_type, Type>);
|
|
|
-
|
|
|
|
|
- using comp_traits = component_traits<Type>;
|
|
|
|
|
using underlying_type = basic_sparse_set<Entity, typename alloc_traits::template rebind_alloc<Entity>>;
|
|
using underlying_type = basic_sparse_set<Entity, typename alloc_traits::template rebind_alloc<Entity>>;
|
|
|
using container_type = std::vector<typename alloc_traits::pointer, typename alloc_traits::template rebind_alloc<typename alloc_traits::pointer>>;
|
|
using container_type = std::vector<typename alloc_traits::pointer, typename alloc_traits::template rebind_alloc<typename alloc_traits::pointer>>;
|
|
|
|
|
+ using comp_traits = component_traits<Type>;
|
|
|
|
|
|
|
|
[[nodiscard]] auto &element_at(const std::size_t pos) const {
|
|
[[nodiscard]] auto &element_at(const std::size_t pos) const {
|
|
|
return packed.first()[pos / comp_traits::page_size][fast_mod(pos, comp_traits::page_size)];
|
|
return packed.first()[pos / comp_traits::page_size][fast_mod(pos, comp_traits::page_size)];
|
|
@@ -744,13 +743,12 @@ private:
|
|
|
|
|
|
|
|
/*! @copydoc basic_storage */
|
|
/*! @copydoc basic_storage */
|
|
|
template<typename Entity, typename Type, typename Allocator>
|
|
template<typename Entity, typename Type, typename Allocator>
|
|
|
-class basic_storage<Entity, Type, Allocator, std::enable_if_t<ignore_as_empty_v<Type>>>
|
|
|
|
|
|
|
+class basic_storage<Entity, Type, Allocator, std::enable_if_t<component_traits<Type>::page_size == 0u>>
|
|
|
: public basic_sparse_set<Entity, typename std::allocator_traits<Allocator>::template rebind_alloc<Entity>> {
|
|
: public basic_sparse_set<Entity, typename std::allocator_traits<Allocator>::template rebind_alloc<Entity>> {
|
|
|
using alloc_traits = std::allocator_traits<Allocator>;
|
|
using alloc_traits = std::allocator_traits<Allocator>;
|
|
|
static_assert(std::is_same_v<typename alloc_traits::value_type, Type>);
|
|
static_assert(std::is_same_v<typename alloc_traits::value_type, Type>);
|
|
|
-
|
|
|
|
|
- using comp_traits = component_traits<Type>;
|
|
|
|
|
using underlying_type = basic_sparse_set<Entity, typename alloc_traits::template rebind_alloc<Entity>>;
|
|
using underlying_type = basic_sparse_set<Entity, typename alloc_traits::template rebind_alloc<Entity>>;
|
|
|
|
|
+ using comp_traits = component_traits<Type>;
|
|
|
|
|
|
|
|
public:
|
|
public:
|
|
|
/*! @brief Base type. */
|
|
/*! @brief Base type. */
|