| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"Ben Pfaff" |
| Date: |
31 Jan 2008 12:30:09 PM |
| Object: |
std::list<>::splice invalidation of iterators |
The C++ standard says in 23.2.2.4 "list operations" that the
various forms of splice invalidate iterators and references to
the spliced elements. This makes the splice operation a lot less
useful than it otherwise could be. It seems unnecessary to
invalidate these iterators and references, and I am puzzled why
the standard says that it happens. Furthermore, the "merge"
operation that also moves elements from one list to another does
not have any note saying that it invalidates any iterators or
references.
Can anyone enlighten me?
--
"While the Melissa license is a bit unclear, Melissa aggressively
encourages free distribution of its source code."
--Kevin Dalley <kevin@seti.org>
.
|
|
| User: "" |
|
| Title: Re: std::list<>::splice invalidation of iterators |
31 Jan 2008 07:20:55 PM |
|
|
Ben Pfaff wrote:
The C++ standard says in 23.2.2.4 "list operations" that the
various forms of splice invalidate iterators and references to
the spliced elements. This makes the splice operation a lot less
useful than it otherwise could be. It seems unnecessary to
invalidate these iterators and references, and I am puzzled why
the standard says that it happens.
No reason. The working paper n2461 indicates that the next standard will
change those provisions.
Furthermore, the "merge"
operation that also moves elements from one list to another does
not have any note saying that it invalidates any iterators or
references.
Can anyone enlighten me?
Best
Kai-Uwe Bux
.
|
|
|
| User: "Ben Pfaff" |
|
| Title: Re: std::list<>::splice invalidation of iterators |
31 Jan 2008 09:03:20 PM |
|
|
writes:
Ben Pfaff wrote:
The C++ standard says in 23.2.2.4 "list operations" that the
various forms of splice invalidate iterators and references to
the spliced elements. This makes the splice operation a lot less
useful than it otherwise could be. It seems unnecessary to
invalidate these iterators and references, and I am puzzled why
the standard says that it happens.
No reason. The working paper n2461 indicates that the next standard will
change those provisions.
Thanks so much for pointing that out. The provisions of n2461
look great.
--
Ben Pfaff
http://benpfaff.org
.
|
|
|
|
|

|
Related Articles |
|
|