This is the mail archive of the
mailing list for the libstdc++ project.
Re: [v3 PATCH] Implement 2801, Default-constructibility of unique_ptr.
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 4 Jan 2017 12:54:13 +0000
- Subject: Re: [v3 PATCH] Implement 2801, Default-constructibility of unique_ptr.
- Authentication-results: sourceware.org; auth=none
- References: <CAFk2RUbSRwUJP0F=XPfeCmefY-cHrV3LwNvzW_XLNR_R3-r+0Q@mail.gmail.com> <20161222171123.GY895@redhat.com> <CAFk2RUb9Gkv+0T526+gh=9xL_JzTCjbQa18RM4Jr9S6bJ4firstname.lastname@example.org> <CAFk2RUYBpMT6iJF-XCFK986QSpHLpJju3MBbareTveK=-8hESw@mail.gmail.com>
On 29/12/16 22:10 +0200, Ville Voutilainen wrote:
On 29 December 2016 at 21:57, Ville Voutilainen
Instead of repeating this condition half a dozen times, we could put
it in the __uniq_ptr_impl class template and reuse it, as in the
attached patch (and similarly for the unique_ptr<t> specialization).
What do you think?
It needs to be a bit more dependent than in that patch, I think. I
adjusted the idea a bit,
a new patch attached. It cleans up the code a bit, so it's better, but
not a huge improvement.
Gets a bit better by keeping the __uniq_ptr_impl as just an enable_if,
aliasing its ::type locally
and then using the result in the constraints. Also gets rid of a bunch
of dg-errors in
ptr_deleter_neg.cc. This makes me quite happy. The attached _3.diff
shows the cleanup,
the _4.diff shows the full patch with this cleanup applied.
Looks good. OK for trunk, thanks.