How can unique_ptr have no overhead if it needs to store the deleter?
First take a look at what C++ Primer said about unique_ptr and shared_ptr : $16.1.6. Efficiency and Flexibility We can be certain that shared_ptr does not hold the deleter as a direct member, because the type of the deleter isn’t known until run time. Because the type of the deleter is part of the type of a unique_ptr , the type of the deleter member is known at compile time. The deleter can be stored directly in each unique_ptr object. So it seems like that the shared_ptr does not have a direct member of deleter, but unique_ptr does. However, the top-voted answer of another question says: If