In 20.7.2.2 The only constructors for shared_ptr
I see that accept a deleter are ones that accept raw pointers or nullptr_t
.
For unique_ptr
, from 20.7.1.2 it looks like you could concoct a deleter type for which the underlying typedef would be another unique_ptr
, but in order to retain the correct semantics you would have to take ownership of the object itself, so changing the deleter wouldn't necessarily be a problem (for example you might change it from immediate delete to return-to-pool on the fly).