throw std::invalid_argument("Owned::Owned");
Stage &stage = get_stage(*parent);
- Pool<T> &pool = stage.get_pools().template get_pool<T>();
+ Pool<T> &pool = stage.get_pools().get_pool<T>();
this->ptr = pool.create(parent, std::forward<Args>(args)...);
if constexpr(std::is_base_of_v<Component, T>)
{
parent->remove_child(*this);
}
- Pool<T> &pool = stage.get_pools().template get_pool<T>();
+ Pool<T> &pool = stage.get_pools().get_pool<T>();
pool.destroy(this->ptr);
}
void PoolBase::destroy_all()
{
if(object_count>0)
- IO::print(IO::cerr, "Warning: pool is being destroyed but has %d live objects", object_count);
+ IO::print(IO::cerr, "Warning: pool is being destroyed but has %d live objects\n", object_count);
unsigned block_count = capacity/BLOCK_SIZE;
for(unsigned i=0; i<block_count; ++i)
-#ifndef MSP_GAME_STORAGE_H_
-#define MSP_GAME_STORAGE_H_
+#ifndef MSP_GAME_POOL_H_
+#define MSP_GAME_POOL_H_
#include <cstdint>
#include <memory>