This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++14 status.
forward_list::splice_after single-element overloadSection: 23.3.7.6 [forward.list.ops] Status: C++14 Submitter: Edward Catmur Opened: 2012-12-11 Last modified: 2023-02-07
Priority: Not Prioritized
View all other issues in [forward.list.ops].
View all issues with C++14 status.
Discussion:
[forwardlist.ops] p6 has
void splice_after(const_iterator position, forward_list& x, const_iterator i); void splice_after(const_iterator position, forward_list&& x, const_iterator i);Effects: Inserts the element following
iinto*this, followingposition, and removes it fromx. The result is unchanged ifposition == iorposition == ++i. Pointers and references to*icontinue to refer to the same element but as a member of*this. Iterators to*i(includingiitself) continue to refer to the same element, but now behave as iterators into*this, not intox.
This overload splices the element following i from x to *this, so the
language in the two latter sentences should refer to ++i:
Pointers and references to
*++icontinue to refer to the same element but as a member of*this. Iterators to*++icontinue to refer to the same element, but now behave as iterators into*this, not intox.
[2013-03-15 Issues Teleconference]
Moved to Tentatively Ready.
[2013-04-20 Bristol]
Proposed resolution:
This wording is relative to N3485.
Edit [forwardlist.ops] p6 as indicated:
void splice_after(const_iterator position, forward_list& x, const_iterator i); void splice_after(const_iterator position, forward_list&& x, const_iterator i);-5- Requires:
-6- Effects: Inserts the element followingpositionisbefore_begin()or is a dereferenceable iterator in the range[begin(),end()). The iterator followingiis a dereferenceable iterator inx.get_allocator() == x.get_allocator().iinto*this, followingposition, and removes it fromx. The result is unchanged ifposition == iorposition == ++i. Pointers and references to*++icontinue to refer to the same element but as a member of*this. Iterators to*++i(includingcontinue to refer to the same element, but now behave as iterators intoiitself)*this, not intox.