File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ I'd like to withdraw my NAD suggestion. The value of <tt>use_count()</tt> is alr
5454<tt >shared_ptr</tt > and <tt >weak_ptr</tt > objects that share ownership, so specifying when it changes ensures correct
5555behaviour.
5656</p >
57+
58+ <note >2025-03-18, Jonathan comments</note >
59+ <p >See also <iref ref =" 2907" />.</p >
60+
5761</discussion >
5862
5963<resolution >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ running the destructor for <tt>d</tt> only when the last <tt>weak_ptr</tt> is de
1818but ensuring that <tt >d(p)</tt > completes before the <tt >shared_ptr</tt > gives up its weak reference; making a copy of
1919<tt >d</tt > in the destructor before manipulating the weak count, and then using this copy to run <tt >d(p)</tt >, even while
2020the control-block could be concurrently reclaimed with an expiring <tt >weak_ptr</tt > in another thread. Note that this
21- may be related to LWG <iref ref =" 2751" />. (Also, see the note in 20.11.2.2.10 p1 [util.smartptr.getdeleter])</p >
21+ may be related to LWG <iref ref =" 2751" />. (Also, see the note in < sref ref = " [util.smartptr.getdeleter]" /> p1 )</p >
2222
2323<p >Proposed change: Clarify that the <tt >shared_ptr</tt > weak ownership of the control block is released at the end of the
2424destructor, and not as the destructor begins. Otherwise, the deleter might be destroyed even before the destructor gets to
You can’t perform that action at this time.
0 commit comments