std::unique_ptr<T[]> and custom allocator deleter
问题 I am trying to use std::unique_ptr<T[]> with custom memory allocators. Basically, I have custom allocators that are subclasses of IAllocator , which provides the following methods: void* Alloc( size_t size ) template<typename T> T* AllocArray( size_t count ) void Free( void* mem ) template<typename T> void FreeArray( T* arr, size_t count ) Since the underlying memory might come from a pre-allocated block, I need the special ...Array() -methods to allocate and free arrays, they allocate/free