public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tim Song <t.canens.cpp@gmail.com>
To: Patrick Palka <ppalka@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	"libstdc++" <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: Fix iterator caching inside range adaptors [PR100479]
Date: Mon, 17 May 2021 17:28:19 -0500	[thread overview]
Message-ID: <CAPQZVxtO2=EeRkN+3Qreq2jgxm4fcwimo-JbPgWw3CVC99xBvg@mail.gmail.com> (raw)
In-Reply-To: <a4e9cb96-0d6-a052-82f8-f1c17e49edf6@idea>

On Mon, May 17, 2021 at 2:59 PM Patrick Palka <ppalka@redhat.com> wrote:
>
> +       constexpr _CachedPosition&
> +       operator=(_CachedPosition&& __other) noexcept
> +       {
> +         if (std::__addressof(__other) != this)

I don't think we need this check - self-move-assigning the underlying
view isn't required to be a no-op, so we should still invalidate.


> +           {
> +             // Propagate the cached offset, but invalidate the source.
> +             this->_M_offset = __other._M_offset;
> +             __other._M_offset = -1;
> +           }
> +         return *this;
> +       }

  reply	other threads:[~2021-05-17 22:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 15:43 Patrick Palka
2021-05-17 16:51 ` Jonathan Wakely
2021-05-17 18:39 ` Tim Song
2021-05-17 19:59   ` Patrick Palka
2021-05-17 22:28     ` Tim Song [this message]
2021-05-18  4:53       ` Patrick Palka
2021-05-24 18:59         ` Jonathan Wakely

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='CAPQZVxtO2=EeRkN+3Qreq2jgxm4fcwimo-JbPgWw3CVC99xBvg@mail.gmail.com' \
    --to=t.canens.cpp@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).