forward_list::splice_after

Restitches links between nodes.

void splice_after(const_iterator _Where, forward_list& _Right);
void splice_after(const_iterator _Where, forward_list& _Right,
    iterator _First);
void splice_after(const_iterator _Where, forward_list& _Right,
    iterator _First, iterator _Last);

Parameters

Parameter

Description

_Where

The position in the target forward list to splice.

_First

The beginning of the restitched range.

_Last

The end of the restitched range.

_Right

The forward list to splice from.

Remarks

The first member function inserts the sequence controlled by _Right just after the element in the controlled sequence pointed to by _Where. It also removes all elements from _Right. (&_Right must not equal this.)

The second member function removes the element just after _First in the sequence controlled by _Right and inserts it just after the element in the controlled sequence pointed to by _Where. (If _Where == _First || _Where == ++_First, no change occurs.)

The third member function inserts the subrange designated by (_First, _Last) from the sequence controlled by _Right just after the element in the controlled sequence pointed to by _Where. It also removes the original subrange from the sequence controlled by _Right. (If &_Right == this, the range (_First, _Last) must not include the element pointed to by _Where.)

If the third member function inserts N elements, and &_Right != this, an object of class iterator is incremented N times. For all splice_after member functions, if get_allocator() == str.get_allocator(), no exception occurs. Otherwise, a copy and a destructor call also occur for each inserted element.

No iterators or references that designate spliced elements become invalid.

Requirements

Header: <forward_list>

Namespace: std

See Also

Reference

forward_list Class

Other Resources

forward_list Members