From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 652A9385781C; Thu, 17 Jun 2021 18:28:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 652A9385781C Received: by mail-wm1-x336.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso5332446wmc.1; Thu, 17 Jun 2021 11:28:19 -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=W7FMHy7mBCQZZlQ+txlj7OYehWcufywmlRCi9II7zuc=; b=brwl0fELIwgNhZsgiGJKaWtE+DIUuH54vakuTZYD+WEraGjENgW118tuRgxwGkVZ1M qJDjmJn0FNnkO79yyq+JxFsru8XfJd+u5XtcqdzSVEOQp84LMt4SeOKbC0NMNzAa0TcM b10/k5Uz72CsrGUEf1951xy5UZ/In1Y5TTkHuYQFpA/Q8vXnVUvzDQviFMjNryYnQCEj 3p96A+oJvt5FfaUqo3yePwvpaEgW1GAC1FdtTr+BAirj8xhgAJp4Xy+4z/CRxTGeI6jH opuSixHWOa/LL98K8yxJcXBZrOY/HorXnnxR4skxav3fWHAhvKYSrC2d7CPFNi/f16aC yOoA== X-Gm-Message-State: AOAM532Hf0NHZ2hxNUebX9UuuCDgQ010FSiq5yToPzVm4Pzx4CUBX0V+ ZHdDih2nwxaIdN7nXMkOWqRQ+8VjLNX5EyDROJM= X-Google-Smtp-Source: ABdhPJwLTqGzTi1rF6MXr2ofIPlgQR2dxdmjKnkFFHh1EiDIKpL3exGrtqVU3Uhy44ljPXba4wboWwQveaN4vGFj9Q8= X-Received: by 2002:a05:600c:410c:: with SMTP id j12mr6630135wmi.117.1623954498438; Thu, 17 Jun 2021 11:28:18 -0700 (PDT) MIME-Version: 1.0 References: <20210617152206.1408001-1-ppalka@redhat.com> In-Reply-To: From: Jonathan Wakely Date: Thu, 17 Jun 2021 19:28:06 +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.5 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:28:20 -0000 On Thu, 17 Jun 2021, 19:19 Jonathan Wakely, wrote: > > > 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. > Because the default member initializers are in the immediate context, so the constructor would look valid to is_default_constructible, and only get deleted when instantiated. (Thanks to Barry for reminding me of that.) >