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.133.124]) by sourceware.org (Postfix) with ESMTPS id 589203858402 for ; Wed, 20 Oct 2021 08:42:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 589203858402 Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-lMt5oCodOAmrGQkyPKl-Sg-1; Wed, 20 Oct 2021 04:42:40 -0400 X-MC-Unique: lMt5oCodOAmrGQkyPKl-Sg-1 Received: by mail-ua1-f72.google.com with SMTP id c18-20020ab04852000000b002c9ff3ffa97so1447256uad.4 for ; Wed, 20 Oct 2021 01:42:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lapJeQIxAMHP7+Qm0ms9ASgLeByU7IyRk/jQcaYeDcw=; b=QJYKWIA8Zed5yIPrTKY4AiYVSsh4lurrEZ4mkw6kdkvM/H3ALn1JX8FBJSXridEGqJ Q5H4jSNBMF4HVURqKOkvrY9swn/5XX4VKB9xwBFK0L0DLFxcRLPAnT6wAwGFEuwMWUhu WfqfL7delTQFVDC2btSkts2R5WlG/Lp55SNs9JCnmx5j4rg2N5sDfetwcBSFkRyPI11B kf7Tr+TsjLM7IcB3mBigE/hT8nwvQrbzWzSPXygcIN2ZkDY5Orqg/0NcsvxYQcg0Zvw0 MMYtgV8Fx90d/EK2Q/GMRhsaRhJcABx918LaqyZxQXLHhV3aR3tA+vNFrDY1LjJColz5 eTnQ== X-Gm-Message-State: AOAM532WS/5EQdvaM+iukevvp0hV2UaufaupAwT+LTIa7oWS38XrVZpC 3IYmNeG6P2z0WFGHUv9n5vLu69faaZ+3QKlJ6/dqSKpbe9nPBwpj1Rjs76N7agXKCkSHScjxOY3 seMMWX7sE5vQFFCsrfdMis86bpage2ps= X-Received: by 2002:a67:e0c2:: with SMTP id m2mr41385849vsl.2.1634719360404; Wed, 20 Oct 2021 01:42:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRsPyBtuadAVFnjNYYeuJCtdFa7xSWF8cPFhseorVQcrRyQuW5nVJjggVMBpMu9J1rc79HFKVs3IkofVrK/A4= X-Received: by 2002:a67:e0c2:: with SMTP id m2mr41385843vsl.2.1634719360230; Wed, 20 Oct 2021 01:42:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 20 Oct 2021 09:42:29 +0100 Message-ID: Subject: Re: [committed] libstdc++: Implement monadic operations for std::optional (P0798R8) To: Tim Song Cc: "libstdc++" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2021 08:42:43 -0000 On Wed, 20 Oct 2021 at 06:48, Tim Song wrote: > > On Tue, Oct 19, 2021 at 9:05 AM Jonathan Wakely via Gcc-patches > wrote: > > > > +constexpr bool > > +test_copy_elision() > > +{ > > + return true; > > +} > > + > > +static_assert( test_copy_elision() ); > > + > > This isn't much of a test :) The ultimate copy elision. The copies even get removed from the source code. Thanks for spotting it. I meant to check we're constructing directly into the union member without materializing the temporary early. I'll add that today.