Diagram of std::shared_ptr memory layout: one pointer to the T object and one to a control block holding the reference count, weak count and other data such as a custom deleter or allocator

C++ unique/shared ptr custom deleters

I’ve recently found the need for a custom deleter function attached to smart pointers in C++ and I found there are a number of different ways to…

23 January 2020 · 5 min · Alex Houghton