This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3 PATCH] Implement N4387 and LWG 2367
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: 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: Sun, 7 Jun 2015 11:12:55 +0300
- Subject: Re: [v3 PATCH] Implement N4387 and LWG 2367
- Authentication-results: sourceware.org; auth=none
- References: <CAFk2RUZEEUFNeNdOpLdvGAcYZTk2+5B4HTRz5rfTaZHSBJBxJw at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1506070748560 dot 2000 at laptop-mg dot saclay dot inria dot fr>
On 7 June 2015 at 09:53, Marc Glisse <marc.glisse@inria.fr> wrote:
> Since the paper does not mention looking at _MoveConstructibleTuple or
> _ImplicitlyMoveConvertibleTuple here, could you add a comment explaining
> why that is needed?
Sure.
> Does the following code still compile with your patch?
> struct A { int a,b; };
> std::tuple<int,int,A> a(3,4,{1,2});
No. :/ And we have no test for it.. I'll need to look at that.
> IMO the parts with is_default_constructible point to a core issue, we should
> not have to duplicate information, especially in such a convoluted way. But
> I guess that has lower priority than noexcept(auto), and I haven't yet
> looked if concepts will help.
Concepts would help a lot, but being able to use them in a library
implementation
is some ways off.
> You use a lot: typename enable_if<X, bool>::type=true
> while the current code seems to favor: class=typename enable_if<X>::type.
> I don't really care which one is used, but it is easier to read when the
> style is consistent through the library.
It's not a style issue. That template parameter needs to be a non-type one,
otherwise the overloads are ambiguous.
> Introducing
> typename _XXX = _TC<(sizeof...(_Elements) == sizeof...(_UElements)),
> _Elements...>
> and then using _XXX::template thing() might give less clutter when you have
> to repeat it 4 times.
Sounds good, I'll give it a spin.