public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Patrick Palka <ppalka@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	"libstdc++" <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH 1/5] libstdc++: Implement P2325 changes to default-constructibilty of views
Date: Thu, 17 Jun 2021 19:28:06 +0100	[thread overview]
Message-ID: <CAH6eHdTc13s7ix_oEr2QKf05h2xom8ZPSQ_xp44nuxo8_TE3WA@mail.gmail.com> (raw)
In-Reply-To: <CAH6eHdTKnRD_CAjUoPs37NvkZaMwdCDEQh3p3kDg_hF2BQcbWA@mail.gmail.com>

On Thu, 17 Jun 2021, 19:19 Jonathan Wakely, <jwakely.gcc@gmail.com> 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.)

>

      reply	other threads:[~2021-06-17 18:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 15:22 Patrick Palka
2021-06-17 15:22 ` [PATCH 2/5] libstdc++: Move ranges algos used by <ranges> into ranges_util.h Patrick Palka
2021-06-17 18:14   ` Jonathan Wakely
2021-06-17 15:22 ` [PATCH 3/5] libstdc++: Rename views::split to views::lazy_split as per P2210 Patrick Palka
2021-06-18 21:56   ` Jonathan Wakely
2021-06-17 15:22 ` [PATCH 4/5] libstdc++: Implement resolution of LWG 3478 " Patrick Palka
2021-06-18 21:57   ` Jonathan Wakely
2021-06-17 15:22 ` [PATCH 5/5] libstdc++: Implement new views::split " Patrick Palka
2021-06-18 21:58   ` Jonathan Wakely
2021-06-17 18:19 ` [PATCH 1/5] libstdc++: Implement P2325 changes to default-constructibilty of views Jonathan Wakely
2021-06-17 18:28   ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH6eHdTc13s7ix_oEr2QKf05h2xom8ZPSQ_xp44nuxo8_TE3WA@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ppalka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).