registry: pass the allocator to the pools
This commit is contained in:
3
TODO
3
TODO
@@ -11,6 +11,9 @@ DOC:
|
||||
* examples (and credits) from @alanjfs :)
|
||||
* update entity doc when the storage based model is in place
|
||||
|
||||
TODO (high prio):
|
||||
* remove the static storage from the const assure in the registry
|
||||
|
||||
WIP:
|
||||
* get rid of observers, storage based views made them pointless - document alternatives
|
||||
* add storage getter for filters to views and groups
|
||||
|
||||
@@ -255,7 +255,7 @@ class basic_registry {
|
||||
using entity_traits = entt_traits<Entity>;
|
||||
|
||||
template<typename Type>
|
||||
using storage_for_type = typename storage_for<Type, Entity>::type;
|
||||
using storage_for_type = typename storage_for<Type, Entity, typename alloc_traits::template rebind_alloc<std::remove_const_t<Type>>>::type;
|
||||
|
||||
template<typename...>
|
||||
struct group_handler;
|
||||
@@ -312,7 +312,7 @@ class basic_registry {
|
||||
auto &cpool = pools[id];
|
||||
|
||||
if(!cpool) {
|
||||
cpool.reset(new storage_for_type<Type>{});
|
||||
cpool.reset(new storage_for_type<Type>{get_allocator()});
|
||||
cpool->bind(forward_as_any(*this));
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ class basic_registry {
|
||||
return static_cast<const storage_for_type<Type> &>(*it->second);
|
||||
}
|
||||
|
||||
static storage_for_type<Type> placeholder{};
|
||||
static storage_for_type<Type> placeholder{get_allocator()};
|
||||
return placeholder;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user