public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Marc Glisse <marc.glisse@inria.fr>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [libstdc++/61347] std::distance(list.first(),list.end()) in O(1)
Date: Tue, 14 Apr 2015 09:32:00 -0000	[thread overview]
Message-ID: <20150414093209.GQ9755@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1504140951460.27632@stedding.saclay.inria.fr>

On 14/04/15 10:24 +0200, Marc Glisse wrote:
>On Mon, 13 Apr 2015, Jonathan Wakely wrote:
>
>>I don't have a preference, but I think the forward declarations should
>>work without problems. <list> includes bits/stl_iterator_base_funcs.h
>>so if the forward declarations didn't match the definitions for some
>>reason we'd know right away.
>
>Here is a new version that also passes the tests. I guess we will have 
>plenty of time during stage1 to notice if it causes problems. We could 
>probably move the new definitions of __distance to 
>bits/stl_iterator_base_funcs.h, I don't have a clear preference.

Seems like a great start and we can improve it later if needed.

OK for trunk, thanks.

We should also look into applying the same optimisation for
__gnu_debug::list, as long as we don't lose the ability to detect
errors like std::distance(l1.begin(), l2.end()) where &l1 != &l2.

      reply	other threads:[~2015-04-14  9:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 11:42 Marc Glisse
2015-04-13 13:40 ` Jonathan Wakely
2015-04-13 14:15   ` Marc Glisse
2015-04-13 15:11     ` Jonathan Wakely
2015-04-14  8:24       ` Marc Glisse
2015-04-14  9:32         ` 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=20150414093209.GQ9755@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=marc.glisse@inria.fr \
    /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).