public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tudor Hulubei <tudor.hulubei@ecora.com>
To: Michael Vance <briareos@lokigames.com>
Cc: Daniel Berlin <dan@cgsoftware.com>, gcc@gcc.gnu.org
Subject: Re: list<>.size()
Date: Fri, 31 Mar 2000 17:46:00 -0000	[thread overview]
Message-ID: <14565.21720.101359.683025@data.ecora.com> (raw)
In-Reply-To: <20000331173410.D807@namaste.lokigames-lan.com>

  On Friday, 31 March 2000, Michael Vance wrote:
> I port code for a living. I have no control over the original
> developer's intelligence. But it seems this thing wouild be trivial to
> implement and rectify an important porting issue.

What makes you think it is trivial to implement?

Think about splice:

void splice(iterator position, list<T, Alloc>& x, iterator f, iterator l);

This is the corresponding documentation from the STL library:

---
position must be a valid iterator in *this, and [first, last) must be
a valid range in x. position may not be an iterator in the range
[first, last). Splice moves the elements in [first, last) from x to
*this, inserting them before position. All iterators remain valid,
including iterators that point to elements of x. [3] This function is
constant time.
---

Since splice must be O(1), you can't count the elements you move from
one list to another, and therefore it is not possible to keep count of 
the elements in the target list.

Do you have any idea how the Microsoft implementation works so that it 
achieves O(1) for list<>.size()?

Tudor

  reply	other threads:[~2000-03-31 17:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-31 16:33 list<>.size() Michael Vance
2000-03-31 17:08 ` list<>.size() Daniel Berlin
2000-03-31 17:34   ` list<>.size() Michael Vance
2000-03-31 17:46     ` Tudor Hulubei [this message]
2000-03-31 18:08       ` list<>.size() Michael Vance
     [not found]         ` <d97lei1oh1.fsf@han.cs.umn.edu>
2000-03-31 19:46           ` list<>.size() Michael Vance
2000-04-01  1:46         ` list<>.size() llewelly
2000-03-31 18:01     ` list<>.size() Joe Buck
2000-03-31 18:11       ` list<>.size() Michael Vance
2000-04-03  9:05         ` list<>.size() Joe Buck
2000-04-03 13:36           ` list<>.size() Ross Smith
2000-03-31 20:09 ` list<>.size() Dima Volodin

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=14565.21720.101359.683025@data.ecora.com \
    --to=tudor.hulubei@ecora.com \
    --cc=briareos@lokigames.com \
    --cc=dan@cgsoftware.com \
    --cc=gcc@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: 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).