[patch] Fix std::experimental::any for small, non-trivial objects
Jonathan Wakely
jwakely@redhat.com
Sat May 2 12:39:00 GMT 2015
My initial implementation of experimental::any was too dumb, it
assumed you could just swap the bytes of _Storage, and return it from
functions like any POD type, but if the _Storage object contains a
non-trivially-copyable object internally (not on the heap) then it's
wrong to treat it as a POD.
This patch makes the _Storage object non-copyable and fixes all the
uses of it.
Tested powerpc64le-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 10083 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150502/e627d5c9/attachment.bin>
More information about the Libstdc++
mailing list