This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][GSoC] Extend shared_ptr to support arrays
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Fan You <youfan dot noey at gmail dot com>
- Cc: Tim Shen <timshen at google dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 15 Jun 2015 10:38:29 +0100
- Subject: Re: [PATCH][GSoC] Extend shared_ptr to support arrays
- Authentication-results: sourceware.org; auth=none
- References: <CALvpekGQvTp2zRz65cnP+Ex7TKHQygdrYkqo5nUKGJ3bLQj8ww at mail dot gmail dot com> <CAG4ZjNkEPsJd4Crx1xtp4ZvJ-xFGJ5aaR8qb+A7aVMi++wKRtw at mail dot gmail dot com> <20150612090414 dot GP12728 at redhat dot com> <CALvpekG4+YxSVz+jm_quo20=2bWYXnkBFrjDyBu6eYXW4YarHQ at mail dot gmail dot com>
On 14/06/15 23:45 +0800, Fan You wrote:
This is the revised patch.
Bootstrapped and Tested on Darwin 10.9.4. with testsuite 20_util/*
Great, it's *very* important that you can run the tests, so we know
your changes haven't broken the existing code.
You will also need to write new tests (under testsuite/experimental/)
to check that your new code works as intended.
Tim also advice to do this:
__shared_ptr<libfund<_Tp>> : private __shared_ptr<std::remove_extent<_Tp>>
to prevent changing everything once __shared_ptr<_Tp> has changed.
Yes, that probably makes sense.
This patch is looking much better now.
I noticed this macro is wrong:
+#define __cpp_lib_experimental_shared_ptr_array 201506
The correct name and value are given in
https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#general.feature.test
I wonder if all the new code really needs to be in <bits/shared_ptr.h>
or if it can just be in <experimental/memory> instead. There should be
no need to declare most of it (except maybe the enable_shared_from_this
parts?) when users include <memory>.