[v3 patch] Only set std::enable_shared_from_this member once.

Jonathan Wakely jwakely@redhat.com
Wed Aug 26 14:51:00 GMT 2015


This adds a check to weak_ptr::_M_assign() so that calling
__enable_shared_from_this_helper twice with the same pointer won't
change which shared_ptr object the weak_ptr shares ownership with.

On the lib reflector Peter Dimov convinced me that the
boost::enable_shared_from_this behaviour is preferable to what we do
now. I'm writing a proposal to specify this in the standard, but am
changing it now in our implementation.

Tested powerpc64le-linux, committing to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 6723 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150826/8ef439d1/attachment.bin>


More information about the Libstdc++ mailing list