[v3 PATCH] Implement 2801, Default-constructibility of unique_ptr.
Jonathan Wakely
jwakely@redhat.com
Wed Jan 4 12:54:00 GMT 2017
On 29/12/16 22:10 +0200, Ville Voutilainen wrote:
>On 29 December 2016 at 21:57, Ville Voutilainen
><ville.voutilainen@gmail.com> wrote:
>>> 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.
More information about the Libstdc++
mailing list