Created on 2000-07-14.00:00:00 last changed 172 months ago
Rationale:
The original proposed resolution said that iterators and references would remain "valid". The new proposed resolution clarifies what that means. Note that this only applies to the case of equal allocators. From [default.con.req] paragraph 4, the behavior of list when allocators compare nonequal is outside the scope of the standard.
[ pre-Copenhagen: Howard provided wording. ]
Proposed resolution:
Add a footnote to [list.ops], paragraph 1:
[Footnote: As specified in [default.con.req], paragraphs 4-5, the semantics described in this clause applies only to the case where allocators compare equal. --end footnote]
In [list.ops], replace paragraph 4 with:
Effects: Inserts the contents of x before position and x becomes empty. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into *this, not into x.
In [list.ops], replace paragraph 7 with:
Effects: Inserts an element pointed to by i from list x before position and removes the element from x. The result is unchanged if position == i or position == ++i. Pointers and references to *i continue to refer to this same element but as a member of *this. Iterators to *i (including i itself) continue to refer to the same element, but now behave as iterators into *this, not into x.
In [list.ops], replace paragraph 12 with:
Requires: [first, last) is a valid range in x. The result is undefined if position is an iterator in the range [first, last). Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into *this, not into x.
Section [list.ops] states that
void splice(iterator position, list<T, Allocator>& x);
invalidates all iterators and references to list x.
This is unnecessary and defeats an important feature of splice. In fact, the SGI STL guarantees that iterators to x remain valid after splice.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg2006 |
2010-10-21 18:28:33 | admin | set | messages: + msg2005 |
2010-10-21 18:28:33 | admin | set | messages: + msg2004 |
2000-07-14 00:00:00 | admin | create |