From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106469 invoked by alias); 7 Jun 2015 06:53:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 106450 invoked by uid 89); 7 Jun 2015 06:53:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail3-relais-sop.national.inria.fr Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sun, 07 Jun 2015 06:53:37 +0000 Received: from ip-111.net-81-220-140.rev.numericable.fr (HELO laptop-mg.local) ([81.220.140.111]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Jun 2015 08:53:33 +0200 Date: Sun, 07 Jun 2015 08:13:00 -0000 From: Marc Glisse Reply-To: libstdc++@gcc.gnu.org To: Ville Voutilainen cc: libstdc++@gcc.gnu.org, "gcc-patches@gcc.gnu.org" Subject: Re: [v3 PATCH] Implement N4387 and LWG 2367 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-SW-Source: 2015-06/txt/msg00508.txt.bz2 On Sun, 7 Jun 2015, Ville Voutilainen wrote: - explicit - constexpr tuple(const _Elements&... __elements) + template...>::value + && _TC<(sizeof...(_Elements) == sizeof...(_UElements)), + _Elements...>::template + _ConstructibleTuple<_UElements...>() + && _TC<(sizeof...(_Elements) == sizeof...(_UElements)), + _Elements...>::template + _ImplicitlyConvertibleTuple<_UElements...>() + && !_TC<(sizeof...(_Elements) == sizeof...(_UElements)), + _Elements...>::template + _MoveConstructibleTuple<_UElements...>() + && !_TC<(sizeof...(_Elements) == sizeof...(_UElements)), + _Elements...>::template + _ImplicitlyMoveConvertibleTuple<_UElements...>() + && (sizeof...(_Elements) >= 1), + bool>::type=true> + constexpr tuple(const _UElements&... __elements) : _Inherited(__elements...) { } Since the paper does not mention looking at _MoveConstructibleTuple or _ImplicitlyMoveConvertibleTuple here, could you add a comment explaining why that is needed? Does the following code still compile with your patch? struct A { int a,b; }; std::tuple a(3,4,{1,2}); 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. You use a lot: typename enable_if::type=true while the current code seems to favor: class=typename enable_if::type. I don't really care which one is used, but it is easier to read when the style is consistent through the library. 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. -- Marc Glisse