The boost::ptr_vector has an optional CloneAllocator template parameter that defines the cloning policy. The default heap_clone_allocator is heap_clone_allocator , which simply calls the copy constructor to clone the object.
Clone Allocator is used as a way to add a layer of indirection around cloning. For example, it allows you to create a custom dispenser that correctly handles cloning of a non-copyable type.
For more information, see the Boost Pointer Containers library documentation , which explains the concepts of Clonable and Clone Allocator.
James McNellis
source share