#ifndef _MALLOC_FREE_ALLOCATOR_H_ #define _MALLOC_FREE_ALLOCATOR_H_ #include #include template class MallocFreeAllocator : public Constructor { public: typedef DataType* Pointer; typedef const DataType* ConstPointer; typedef DataType& Reference; typedef const DataType& ConstReference; /*! malloc()'s an object of type \c DataType and returns a pointer to it. */ Pointer Allocate() { return reinterpret_cast(malloc(sizeof(DataType))); } /*! free()'s the given object. */ void Deallocate(Pointer object) { free(object); } }; #endif // _MALLOC_FREE_ALLOCATOR_H_