From 604b19ce74a3d777449e8802c06fb37d8623ab14 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Mon, 21 May 2012 14:19:36 -0400 Subject: [PATCH] Fixed memory pool code --- src/pool.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pool.hpp b/src/pool.hpp index 33eb40f..5d2203b 100644 --- a/src/pool.hpp +++ b/src/pool.hpp @@ -15,11 +15,13 @@ namespace CosmoTool PoolNode *next; }; + template class MemoryPool; + template class MemoryIterator { private: - friend class MemoryPool; + friend class MemoryPool; PoolNode *cur, *previous; uint32_t in_node; @@ -41,7 +43,7 @@ namespace CosmoTool in_node = i.in_node; } - bool MemoryIterator::operator==(const MemoryIterator& i) const + bool operator==(const MemoryIterator& i) const { return (cur == i.cur) && (in_node == i.in_node); } @@ -82,7 +84,7 @@ namespace CosmoTool private: uint32_t m_allocSize; PoolNode *head, *current; - typedef typename MemoryIterator iterator; + typedef MemoryIterator iterator; public: MemoryPool(uint32_t allocSize) : m_allocSize(allocSize), head(0), current(0) {}