public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/61347] std::distance(list.first(),list.end()) in O(1) Date: Sun, 05 Apr 2015 10:17:00 -0000 [thread overview] Message-ID: <bug-61347-4-7quCVtNk12@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-61347-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61347 --- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> --- Created attachment 35231 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35231&action=edit Overload of __distance Here is one way to do it (I will probably protect the new code with defined(__OPTIMIZE__) as well, if we keep __builtin_constant_p). (Looking at the generated code, I was surprised to notice that _M_hook and _M_unhook are in src, they seem rather small for that)
next prev parent reply other threads:[~2015-04-05 10:17 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-05-28 22:23 [Bug libstdc++/61347] New: " glisse at gcc dot gnu.org 2014-05-29 0:28 ` [Bug libstdc++/61347] " redi at gcc dot gnu.org 2014-10-04 10:00 ` fdumont at gcc dot gnu.org 2014-10-10 16:00 ` redi at gcc dot gnu.org 2014-10-13 10:01 ` glisse at gcc dot gnu.org 2015-04-05 10:17 ` glisse at gcc dot gnu.org [this message] 2015-04-14 11:03 ` glisse at gcc dot gnu.org
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=bug-61347-4-7quCVtNk12@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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).