std::list<>::splice invalidation of iterators



 DEVELOP > c-Plus-Plus > std::list<>::splice invalidation of iterators

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
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
.



  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER