[patch] GSoC: Implement std::experimental::shared_ptr
Jonathan Wakely
jwakely@redhat.com
Fri Nov 13 11:31:00 GMT 2015
On 13/11/15 11:09 +0000, Jonathan Wakely wrote:
>This is the other piece of work done by Fan You for the Google Summer
>of Code (and mentored by Tim).
>
>This implements experimental::shared_ptr from the Library Fundamentals
>TS, which differs from std::shared_ptr by supporting arrays, i.e.
>shared_ptr<int[]> and shared_ptr<int[2]> behave correctly, using
>delete[] to free the managed memory, and providing operator[] instead
>of operator* and operator->.
>
>I made a few changes to Fan You's patch:
>
>- moved __libfund_v1 tag type and new partial specializations to
> <experimental/memory>, so all changes are in the experimental dir.
>
>- added a second template parameter to the tag type to distinguish
> arrays from non-arrays, so we can have two partial specializations,
> __shared_ptr<__libfund_v1<T, true>> and __shared_ptr<__libfund_v1<T,
> false>>, with slightly different interfaces.
>
>- added std::hash specialization.
>
>- used remove_extent_t, enable_if_t etc alias templates.
>
>- removed the _Weak_friend helper class.
>
>- fixed some tests that used operator-> on shared_ptr<T[]>.
>
>
>Thanks very much to Fan You, and to TIm Shen and Google.
>
>Tested powerpc64le-linux, committed to trunk.
Oops, I made a small error in the doxygen @file comment, fixed with
this patch. Committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1274 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20151113/7d8e7107/attachment.bin>
More information about the Libstdc++
mailing list