Made memory_pool a template class