J
Jerry Coffin
[ ... ]
Right -- in particular, it's (highly, IMO) questionable
whether it's a good idea to make splicing a lot slower on
the off chance that somebody might eventually call size()
and want it to run faster.
[ ... ]
There probably should be, but I can't find any such
requirement. Assuming there was, then, yes, this
particular problem should disappear.
I'm looking at the real standard (the 2003 version, to be
exact) and I don't see any such requirement with it
either.
I see what you're getting at, however I'm not sure that the splice-
operation is guaranteed to run faster than linear complexity. I've only
got a draft of the standard (to cheap to buy the real thing) and there
it says that it's linear unless the spliced elements already are in the
destination list. On the other hand it would be nice with a faster
implementation.
Right -- in particular, it's (highly, IMO) questionable
whether it's a good idea to make splicing a lot slower on
the off chance that somebody might eventually call size()
and want it to run faster.
[ ... ]
This of course is a problem but shouldn't there be a requirement that
the iterator for the inserts are an iterator of the list on which the
method is called.
There probably should be, but I can't find any such
requirement. Assuming there was, then, yes, this
particular problem should disappear.
Thus if we have two lists A and B and use an iterator
it and perform A.insert(it, elem) would the operation be legal if it
was an iterator in B? A quick search and I've not been able to find such
a provision, however as I said I've just a draft.
I'm looking at the real standard (the 2003 version, to be
exact) and I don't see any such requirement with it
either.