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
i
into*this
, followingposition
, and removes it fromx
. The result is unchanged ifposition == i
orposition == ++i
. Pointers and references to*i
continue to refer to the same element but as a member of*this
. Iterators to*i
(includingi
itself) 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
*++i
continue to refer to the same element but as a member of*this
. Iterators to*++i
continue 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 followingposition
isbefore_begin()
or is a dereferenceable iterator in the range[begin(),end())
. The iterator followingi
is a dereferenceable iterator inx
.get_allocator() == x.get_allocator()
.i
into*this
, followingposition
, and removes it fromx
. The result is unchanged ifposition == i
orposition == ++i
. Pointers and references to*++i
continue 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 intoi
itself)*this
, not intox
.