]> git.tdb.fi Git - libs/game.git/commitdiff
Make pools non-movable
authorMikko Rasa <tdb@tdb.fi>
Sun, 7 May 2023 12:53:07 +0000 (15:53 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 7 May 2023 12:55:41 +0000 (15:55 +0300)
I'm not actually using move semantics for them and they're of dubious
value due to polymorphism anyway.

source/game/pool.cpp
source/game/pool.h

index 95e1b4a261c3137865770d38e0894efb3b03056d..869c571bb74949a70e3684b1936d0c19f187d481 100644 (file)
@@ -18,39 +18,6 @@ PoolBase::PoolBase(uint32_t s, DeleteFunc d):
        deleter(d)
 { }
 
-PoolBase::PoolBase(PoolBase &&other):
-       object_size(other.object_size),
-       blocks(other.blocks),
-       free_list(other.free_list),
-       object_count(other.object_count),
-       capacity(other.capacity),
-       deleter(other.deleter)
-{
-       other.blocks = nullptr;
-       other.free_list = nullptr;
-       other.object_count = 0;
-       other.capacity = 0;
-}
-
-PoolBase &PoolBase::operator=(PoolBase &&other)
-{
-       destroy_all();
-
-       object_size = other.object_size;
-       blocks = other.blocks;
-       free_list = other.free_list;
-       object_count = other.object_count;
-       capacity = other.capacity;
-       deleter = other.deleter;
-
-       other.blocks = nullptr;
-       other.free_list = nullptr;
-       other.object_count = 0;
-       other.capacity = 0;
-
-       return *this;
-}
-
 PoolBase::~PoolBase()
 {
        destroy_all();
index e4fe70453310c3ea337d47ab684d10f8663ae7c1..d64e9f867d71a9fff1ee4cb0890af1736ab868f9 100644 (file)
@@ -56,8 +56,6 @@ private:
 protected:
        PoolBase(std::uint32_t, DeleteFunc);
 public:
-       PoolBase(PoolBase &&);
-       PoolBase &operator=(PoolBase &&);
        ~PoolBase();
 
 protected: