From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 43977385781C; Thu, 17 Jun 2021 18:19:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 43977385781C Received: by mail-wm1-x32b.google.com with SMTP id h21-20020a1ccc150000b02901d4d33c5ca0so2180910wmb.3; Thu, 17 Jun 2021 11:19:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p1zve1G/LMd82btMfJ9y31TIuatZ7jSM1X3wvkZTtsg=; b=Afyvu96s7ECDgoVwyAt4g3RLvCNHU0N3NZDzOTAFGcxZgeuKL2diwNGsmcWtI0yC+y TNy9tIuF6kKpYiz5eMe+sKhMW8h6w9jHp8pMW+KPMj4XpBxs5v2BLIto73lnIZZVohE6 kyR7NLU+lbBCW6PC2I74ShAFeWh/QxycM/ax7LZQ4Eh9y7yW48YJaXDdZIYmlJ8iq5H8 hLeuvNq2ohPiGXu8jlWdqmI/sabi0GqGnFJ1wjY3V7jn6s1We+p/37ObVEQfFt1aAJVu 87pFrLR4Q2zSEdXB7ciTikRoWMysSNrDT5aCeJtjFymMmSirs6ppib118L/azwACk7mU B8IQ== X-Gm-Message-State: AOAM531ZsmB8GTHmtgZN3/GzxLFJ7Mh5z2G/KMrxl7H4Yhk0LJ6huTV4 15zYDOAmgrghnG7J2v/IMYGoQ/N+LW3F6AUJp2Y= X-Google-Smtp-Source: ABdhPJxNqBY9J4ILjJwKYkLzsV931XfMZ8PWwcA6qe0P/yV/BFcZ0tAxNOv6N8dIeU5u9lgHy5ccEknaSvSIYZLDXko= X-Received: by 2002:a05:600c:4e88:: with SMTP id f8mr6675591wmq.14.1623953978342; Thu, 17 Jun 2021 11:19:38 -0700 (PDT) MIME-Version: 1.0 References: <20210617152206.1408001-1-ppalka@redhat.com> In-Reply-To: <20210617152206.1408001-1-ppalka@redhat.com> From: Jonathan Wakely Date: Thu, 17 Jun 2021 19:19:26 +0100 Message-ID: Subject: Re: [PATCH 1/5] libstdc++: Implement P2325 changes to default-constructibilty of views To: Patrick Palka Cc: gcc-patches , "libstdc++" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Thu, 17 Jun 2021 18:19:40 -0000 On Thu, 17 Jun 2021, 16:50 Patrick Palka via Libstdc++, < libstdc++@gcc.gnu.org> wrote: > This implements the wording changes of P2325R3 "Views should not be > required to be default constructible". Changes are relatively > straightforward, besides perhaps those to __box (which now stands > for copyable-box instead of semiregular-box) and __non_propagating_cache. > > For __box, this patch implements the recommended practice to also avoid > std::optional when the boxed type is nothrow_move/copy_constructible. > > For __non_propagating_cache, now that it's used by split_view::_M_current, > we need to add assignment from a value of the underlying type to the > subset of the std::optional API implemented for the cache (needed by > split_view::begin()). Hence the new __non_propagating_cache::operator= > overload. > > While we're changing __box, this fixes the undesirable list-init in > the constuctors of the partial specialization as reported in PR100475 > comment #7. As I said on IRC, I'm not sure why the defaulted default constructors need to be constrained (rather than just letting them get deleted) but the patch is OK.