From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7CA083858D3C for ; Tue, 23 Aug 2022 09:15:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7CA083858D3C Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-569-5HvmBJqqPpalBWNPVUoVUQ-1; Tue, 23 Aug 2022 05:15:20 -0400 X-MC-Unique: 5HvmBJqqPpalBWNPVUoVUQ-1 Received: by mail-qk1-f199.google.com with SMTP id bj2-20020a05620a190200b006bba055ab6eso11563819qkb.12 for ; Tue, 23 Aug 2022 02:15:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=oLKUDMXD/21lCsytkIcKTiaL7kW6e1h5XAO89Di/ZEM=; b=P7a94C+LT1W1ZmVObVH/LUImvthHm681d8SOm2V59A8ONpJfOFTqUENTeZaBc3cQ1G P8Gwj3g9WKxKFcXxZf9J4fDJ7tgk8RErnRtTohASEdYBNpeiBTthkaHMn64FDPH/lzVV Dpmgzmlgre02h9k6JTXOP4PCs1DtP0D/985noA9vL6oHWm4RDZb73jjgS/6GMwjxiJ7T +hWrVk7decIPM36QUJysaZzYg1mRoQqxbZu9id7DvqoMDemGofb5B/qwaogscvdPjU0i /IvJrsUmk1MhM/uxu2TU6LyFuEVEmQf1TgDQoJ+L5bkX1XQHUaMzS/XNqIUazE8Fu5nY 0fEg== X-Gm-Message-State: ACgBeo3yUtD/31TapLIpfuMNhHPH2ZTgo41xd3U7wzW03dsXt56SJhT9 xUcEOIKwyxnz4p2ZkOuS9fbmKfJlpVy00EPdsq3bTU35za5nxpSNfIbmyzKRV8pDhIywqwrHrKp 2lFwOumyanJYXgEDOQ7aCS8L4fnY8gnuS3Q== X-Received: by 2002:a05:620a:884:b0:6bc:2056:1005 with SMTP id b4-20020a05620a088400b006bc20561005mr4835757qka.293.1661246120294; Tue, 23 Aug 2022 02:15:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ulzKe9AE4dcGjsQ52EHH1OWEz6TOwfifaCBNpk7UPSH91W6+1zOKdqKsLy2FYBjEB7NlXUdECgYJ5nAILHco= X-Received: by 2002:a05:620a:884:b0:6bc:2056:1005 with SMTP id b4-20020a05620a088400b006bc20561005mr4835749qka.293.1661246120083; Tue, 23 Aug 2022 02:15:20 -0700 (PDT) MIME-Version: 1.0 References: <20220823013500.1756466-1-ppalka@redhat.com> In-Reply-To: <20220823013500.1756466-1-ppalka@redhat.com> From: Jonathan Wakely Date: Tue, 23 Aug 2022 10:15:09 +0100 Message-ID: Subject: Re: [PATCH 1/3] libstdc++: Separate construct/convertibility tests for std::tuple To: Patrick Palka Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2022 09:15:25 -0000 On Tue, 23 Aug 2022 at 02:35, Patrick Palka via Libstdc++ wrote: > > P2321R2 adds new conditionally explicit constructors to std::tuple which > we'll concisely implement in a subsequent patch using explicit(bool), like > in our C++20 std::pair implementation. But before we can do that, this > patch first adds members to _TupleConstraints that test for constructibility > and convertibility separately; we'll use the first in the new constructors' > constraints, and the second in their explicit specifier. > > In passing, this patch also redefines the existing predicates > __is_ex/implicitly_constructible in terms of these new members. This > seems to reduce compile time and memory usage by about 10% for large Nice. > tuples when using the relevant constructors constrained by > _Explicit/_ImplicitCtor (since we no longer have to redundantly expand > and process is_constructible<_Types, _UTypes>... twice for each pair of > such constructors). In order to retain maximal short circuiting, do > this only when constexpr if is available. Would we get similar benefits for C++11 and C++14 by doing: return __and_<__and_...>, __and_...> >::value; This is slightly more work in total, but if we have __and_ and __and_> then the A and B instantiations will be cached and can be reused. > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? Yes, thanks.