std::get_deleter (3) - Linux Man Pages
template< class Deleter, class T > (since C++11)
Deleter* get_deleter( const std::shared_ptr<T>& p ) noexcept;
Access to the p's deleter. If the shared pointer p owns a deleter of type cv-unqualified Deleter (e.g. if it was created with one of the constructors that take a deleter as a parameter), then returns a pointer to the deleter. Otherwise, returns a null pointer.
p - a shared pointer whose deleter needs to be accessed
A pointer to the owned deleter or nullptr. The returned pointer is valid at least as long as there remains at least one shared_ptr instance that owns it.
The returned pointer may outlive the last shared_ptr if, for example, std::weak_ptrs remain and the implementation doesn't destroy the deleter until the entire control block is destroyed.
demonstrates that shared_ptr deleter is independent of the shared_ptr's type
// Run this code