20
General utilities library
[utilities]
20.11
Smart pointers
[smartptr]
20.11.3
Class template
shared_ptr
[util.smartptr.shared]
20.11.3.10
get_deleter
[util.smartptr.getdeleter]
🔗
template
<
class
D,
class
T
>
D
*
get_deleter
(
const
shared_ptr
<
T
>
&
p
)
noexcept
;
1
#
Returns:
If
p
owns a deleter
d
of type cv-unqualified
D
, returns
addressof
(
d
)
; otherwise returns
nullptr
.
The returned pointer remains valid as long as there exists a
shared_ptr
instance that owns
d
.
[
Note
:
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 with
p
have been destroyed
.
—
end note
]