[util.smartptr.getdeleter] (original) (raw)

20 Memory management library [mem]

20.3 Smart pointers [smartptr]

20.3.2 Shared-ownership pointers [util.sharedptr]

20.3.2.2 Class template shared_ptr [util.smartptr.shared]

20.3.2.2.11 get_deleter [util.smartptr.getdeleter]

Returns: If p owns a deleter d of type cv-unqualifiedD, returns addressof(d); otherwise returns nullptr.

The returned pointer remains valid as long as there exists a shared_ptr instance that owns d.

[Note 1:

It is unspecified whether the pointer remains valid longer than that.

This can happen if the implementation doesn't destroy the deleter until all weak_ptr instances that share ownership withp have been destroyed.

— _end note_]