about SGI list

H

hpsoar

why the splice functions have a parameter of list-reference type not
used? thank you for any clues.
 
H

hpsoar

What are you talking about, exactly?

V

I'm talking about SGI's implementation of list, int the following
function: void splice(iterator position, list&, iterator i) { ... }
the list& is never used, why?
 
A

Alf P. Steinbach

* hpsoar:
{ quoted signature snipped, please don't quote signatures }
I'm talking about SGI's implementation of list, int the following
function: void splice(iterator position, list&, iterator i) { ... }
the list& is never used, why?

As a hint for investigating this (I /think/ it's in the right direction, but I
don't have time to check it out): it's quite possibly related to the freedom
compilers have choosing to have splice op linear time and checking list size
constant, or checking list size linear and splice op constant. With the first
choice the argument would then be used. But as stated, this is just association
(it may not even be a correct description of the constraints & freedoms, and in
particular I'm sure the standard doesn't prescribe a choice); check it out.


Cheers, & hth,

- Alf
 
J

Jorgen Grahn

What are you talking about, exactly?

It seems from his other postings that he is reading the SGI STL source
code. He found that the list you pass to some of the list::splice()
functions is not used.

I guess it's either (a) to allow a different way of implementing
std::list which *would* need that argument, (b) because it's rude to
modify a container using nothing but iterators into it or (c) someone
made a mistake.

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,431
Latest member
ElyseG3173

Latest Threads

Top