Standard C++ Library Reference ISO/IEC (VERSION3)

imposes the order !(*Pj < *Pi) whenever I < J. (The elements are sorted in ascending
order.) The member template function imposes the order !pred(*Pj, *Pi) whenever I <
J. No ordered pairs of elements in the original controlled sequence are reversed in the resulting
controlled sequence. (The sort is stable.)
An exception occurs only if pred throws an exception. In that case, the controlled sequence is
left in unspecified order and the exception is rethrown.
list::splice
void splice(iterator where, list& right);
void splice(iterator where, list& right, iterator first);
void splice(iterator where, list& right, iterator first,
iterator last);
The first member function inserts the sequence controlled by right before 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 pointed to by first in the sequence
controlled by right and inserts it before 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 before 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 member functions, If
get_allocator() == str.get_allocator(), no exception occurs. Otherwise, a
copy and a destructor call also occur for each inserted element.
In all cases, only iterators or references that point at spliced elements become invalid.
list::swap
void swap(list& right);
The member function swaps the controlled sequences between *this and where. If
get_allocator() == where.get_allocator(), it does so in constant time, it
throws no exceptions, and it invalidates no references, pointers, or iterators that designate
elements in the two controlled sequences. Otherwise, it performs a number of element
assignments and constructor calls proportional to the number of elements in the two controlled
sequences.