The std::shared_ptr
of C++ comes with a constructor that takes a custom allocator and deleter for the shared_ptr
:
template< class Y, class Deleter, class Alloc >
shared_ptr( Y* ptr, Deleter d, Alloc alloc );
However the class itself doesn't know about template parameters for the same purpose. Most other template classes in the standard library have a template parameter for allocators. Why doesn't shared_ptr
have the same?
Reason I am asking: I want to have a custom heap implementation to be used with all my standard library classes and the shared_ptr
sticks out a bit due to it only taking the parameter in the constructor.