This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: tuple move constructor
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 6 May 2016 21:53:58 +0300
- Subject: Re: tuple move constructor
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 02 dot 1604202233060 dot 21596 at laptop-mg dot saclay dot inria dot fr> <CAH6eHdRO6kfWqb5K_Nr5WYvHCJNNyQeKSN8VF5c-Ov32HOpU4g at mail dot gmail dot com> <alpine dot DEB dot 2 dot 02 dot 1604211902320 dot 27091 at laptop-mg dot saclay dot inria dot fr> <alpine dot DEB dot 2 dot 20 dot 1605061944340 dot 2019 at laptop-mg dot saclay dot inria dot fr>
On 6 May 2016 at 20:51, Marc Glisse <marc.glisse@inria.fr> wrote:
> Hi Ville,
>
> since you wrote the latest patches on tuple constructors, do you have an
> opinion on this patch, or alternate strategies to achieve the same goal?
>
> https://gcc.gnu.org/ml/libstdc++/2016-04/msg00041.html
I have fairly mixed feelings about the approach; it's adding a tag
type and more enable_ifs into the
base classes of tuple, which I'd rather not do unless absolutely
necessary. Then again, the testcase
you add looks like something we want to support properly. I haven't
analyzed your patch in a very detailed
manner; my initial thought was "can't we do this in the constraints of
tuple's constructors", but looking
at the patch and knowing the constructors of tuple, I don't think we can.
I think the patch is ok, but I think it would be a good idea to have a
comment on the added tag type and
its purpose.
Minor point: the technique that looks like
typename enable_if<
!is_same<_UHead, _Head>::value, bool>::type = false
isn't necessary unless we have another overload that we need to
distinguish with true/false. For a single overload,
just using typename = typename enable_if<
!is_same<_UHead, _Head>::value, bool>::type
works equally well. The amount of boilerplate is more or less the
same, so that's really not a significant matter,
just an fyi. :)