A memory-allocator base class in cpp