From 522992965a245c177762385241a2c049922dc84d Mon Sep 17 00:00:00 2001 From: Mat M Date: Sun, 12 Nov 2017 03:52:34 -0500 Subject: [PATCH] Common: Delete Pool's copy constructor and copy/move assignment operators (#117) The language defines a copy constructor as: TypeName(const TypeName&) so this was just deleting a constructor variant that would catch most cases of attempted copies. --- src/common/memory_pool.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/memory_pool.h b/src/common/memory_pool.h index 1099e62f..90ca59d7 100644 --- a/src/common/memory_pool.h +++ b/src/common/memory_pool.h @@ -21,9 +21,12 @@ public: Pool(size_t object_size, size_t initial_pool_size); ~Pool(); - Pool(Pool&) = delete; + Pool(const Pool&) = delete; Pool(Pool&&) = delete; + Pool& operator=(const Pool&) = delete; + Pool& operator=(Pool&&) = delete; + /// Returns a pointer to an `object_size`-bytes block of memory. void* Alloc();