This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH][GSoC] Extend shared_ptr to support arrays
- From: Tim Shen <timshen at google dot com>
- To: Fan You <youfan dot noey at gmail dot com>
- Cc: Jonathan Wakely <jwakely at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 11 Jun 2015 23:43:41 -0700
- 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>
On Thu, Jun 11, 2015 at 8:32 AM, Fan You <youfan.noey@gmail.com> wrote:
> Hi,
>
> This is my first patch for GSoC project: extend shared_ptr to support
> arrays.
+ using element_type = _Tp[N];
using element_type = typename std::remove_extent_t<_Tp>; ?
> using _Deleter_type = typename conditional<is_array<_Tp>::value,
> _Normal_deleter, _Array_deleter>::type;
Sadly std::default_delete doesn't support _Tp[N]. It will also works
to create a std::default_delete-ish helper trait, with _Tp[N]
specialized to `delete []` as well.
--
Regards,
Tim Shen