1.4 KiB
1.4 KiB
[util.smartptr.shared.dest]
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.3 Destructor [util.smartptr.shared.dest]
constexpr ~shared_ptr();
Effects:
-
If *this is empty or shares ownership with anothershared_ptr instance (use_count() > 1), there are no side effects.
-
Otherwise, if *this owns an objectp and a deleter d, d(p) is called.
-
Otherwise, *this owns a pointer p, and delete p is called.
[Note 1:
Since the destruction of *this decreases the number of instances that share ownership with *this by one, after this has been destroyed all shared_ptr instances that shared ownership withthis will report a use_count() that is one less than its previous value.
â end note]