This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][GSoC] Extend shared_ptr to support arrays


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]