Created on 2017-09-05.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4687.
Edit [forwardlist.ops] p1 as indicated:
void splice_after(const_iterator position, forward_list& x); void splice_after(const_iterator position, forward_list&& x);-1- Requires: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()). get_allocator() == x.get_allocator().
&addressof(x) != this.
Edit [list.ops] p3 as indicated:
void splice(const_iterator position, list& x); void splice(const_iterator position, list&& x);-3- Requires:
&addressof(x) != this.
Edit [list.ops] p3 as indicated:
template <class Compare> void merge(list& x, Compare comp); template <class Compare> void merge(list&& x, Compare comp);-22- Requires: comp shall define a strict weak ordering ([alg.sorting]), and both the list and the argument list shall be sorted according to this ordering.
-23- Effects: If (&addressof(x) == this) does nothing; otherwise, merges the two sorted ranges [begin(), end()) and [x.begin(), x.end()). The result is a range in which the elements will be sorted in non-decreasing order according to the ordering defined by comp; that is, for every iterator i, in the range other than the first, the condition comp(*i, *(i - 1)) will be false. 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. -24- Remarks: Stable ([algorithm.stable]). If (&addressof(x) != this) the range [x.begin(), x.end()) is empty after the merge. No elements are copied by this operation. The behavior is undefined if get_allocator() != x.get_allocator(). -25- Complexity: At most size() + x.size() - 1 applications of comp if (&addressof(x) != this); otherwise, no applications of comp are performed. If an exception is thrown other than by a comparison there are no effects.
[ 2018-3-17 Adopted in Jacksonville ]
[ 2017-11-03 Moved to Tentatively Ready after 9 positive votes for P0 on c++std-lib. ]
[forwardlist.ops] p1 and [list.ops] p3 say &x != this, but should use addressof. We really need front matter saying that when the library says &x it means std::addressof(x).
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2018-03-18 16:03:30 | admin | set | messages: + msg9743 |
2018-03-18 16:03:30 | admin | set | status: voting -> wp |
2018-02-12 01:13:49 | admin | set | status: ready -> voting |
2017-11-03 17:20:12 | admin | set | messages: + msg9503 |
2017-11-03 17:20:12 | admin | set | status: new -> ready |
2017-09-10 12:48:35 | admin | set | messages: + msg9459 |
2017-09-05 00:00:00 | admin | create |