Function |
Description |

`iterator previous(iterator pos)` |
*pos* must be a valid iterator in **this*. The return value is an iterator *prev* such that *++prev == pos*. Complexity: linear in the number of iterators in the range *[begin(), pos)*. |

`const_iterator previous(const_iterator pos)` |
*pos* must be a valid iterator in **this*. The return value is an iterator *prev* such that *++prev == pos*. Complexity: linear in the number of iterators in the range *[begin(), pos)*. |

`iterator insert_after(iterator pos)` |
*pos* must be a dereferenceable iterator in **this*. (That is, *pos* may not be *end()*.) Inserts a copy of *T()* immediately *followingpos*. The return value is an iterator that points to the new element. Complexity: constant time. |

`iterator insert_after(iterator pos, const value_type& x)` |
*pos* must be a dereferenceable iterator in **this*. (That is, *pos* may not be *end()*.) Inserts a copy of *x* immediately *followingpos*. The return value is an iterator that points to the new element. Complexity: constant time. |

`template void insert_after(iterator pos, InputIterator f, InputIterator l)` |
Inserts elements from the range *[f, l)* immediately *followingpos*. Complexity: linear in *last – first*. |

`void insert_after(iterator pos, size_type n, const value_type& x)` |
Inserts *n* copies of *x* immediately *followingpos*. Complexity: linear in *n*. |

`iterator erase_after(iterator pos)` |
Erases the element pointed to by the iterator *followingpos*. Complexity: constant time. |

`iterator erase_after(iterator before_first, iterator last)` |
Erases all elements in the range *[before_first + 1, last)*. Complexity: linear in *last – (before_first + 1)*. |

`void splice(iterator position, slist& x);` |
*position* must be a valid iterator in **this*, and *x* must be an slist that is distinct from **this*. (That is, it is required that *&x != this*.) All of the elements of *x* are inserted before *position* and removed from *x*. All iterators remain valid, including iterators that point to elements of *x*. [4] Complexity: proportional to *c1 (position – begin()) + c2(x.size())*, where *c1* and *c2* are unknown constants. |

`void splice(iterator position, slist& x, iterator i);` |
*position* must be a valid iterator in **this*, and *i* must be a dereferenceable iterator in *x*. *Splice* moves the element pointed to by *i* from *x* to **this*, inserting it before *position* . All iterators remain valid, including iterators that point to elements of *x*. [4] If *position == i* or *position == ++i*, this function is a null operation. Complexity: proportional to *c1(position – begin()) + c2(i – x.begin())*, where *c1* and *c2* are unknown constants. |

`void splice(iterator position, slist& x, iterator f, iterator l);` |
*position* must be a valid iterator in **this* , and *[first, last)* must be a valid range in *x*. *position* may not be an iterator in the range *[first, last)*. *Splice* moves the elements in *[first, last)* from *x* to **this*, inserting them before *position*. All iterators remain valid, including iterators that point to elements of *x*. [4] Complexity: proportional to *c1(position – begin()) + c2(f – x.begin()) + c3(l – f)* , where *c1*, *c2*, and *c3* are unknown constants. |

`void remove(const T& val);` |
Removes all elements that compare equal to *val*. The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. This function is linear time: it performs exactly *size()* comparisons for equality. |

`void splice_after(iterator pos, iterator prev)` |
*pos* must be a dereferenceable iterator in **this*, and *prev* must be a dereferenceable iterator either in **this* or in some other *slist*. (Note: "dereferenceable iterator" implies that neither *pos* nor *prev* may be an off-the-end iterator.) Moves the element *followingprev* to **this*, inserting it immediately *afterpos*. Complexity: constant time. |

`void splice_after(iterator pos, iterator before_first, iterator before_last)` |
*pos* must be a dereferenceable iterator in **this*, and *before_first* and *before_last* must be dereferenceable iterators either in **this* or in some other *slist*. (Note: "dereferenceable iterator" implies that none of these iterators may be off-the-end iterators.) Moves the elements in the range *[before_first + 1, before_last + 1)* to **this*, inserting them immediately *afterpos*. Complexity: constant time. |

`template void remove_if(Predicate p); ` [5] |
Removes all elements **i* such that *p(*i)* is true. The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. This function is linear time: it performs exactly *size()* applications of *p*. |

`void unique();` |
Removes all but the first element in every consecutive group of equal elements. The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. This function is linear time: it performs exactly *size() – 1* comparisons for equality. |

`template void unique(BinaryPredicate p);` [5] |
Removes all but the first element in every consecutive group of equivalent elements, where two elements **i* and **j* are considered equivalent if *p(*i, *j)* is true. The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. This function is linear time: it performs exactly *size() – 1* comparisons for equality. |

`void merge(slist& x);` |
Both **this* and *x* must be sorted according to *operator<*, and they must be distinct. (That is, it is required that *&x != this*.) This function removes all of *x* 's elements and inserts them in order into **this*. The merge is stable; that is, if an element from **this* is equivalent to one from *x*, then the element from **this* will precede the one from *x*. All iterators to elements in **this* and *x* remain valid. This function is linear time: it performs at most *size() + x.size() – 1* comparisons. |

`template void merge(slist& x, BinaryPredicate Comp);` [5] |
*Comp* must be a comparison function that induces a strict weak ordering (as defined in the LessThan Comparable requirements) on objects of type *T*, and both **this* and *x* must be sorted according to that ordering. The slists *x* and **this* must be distinct. (That is, it is required that *&x != this*.) This function removes all of *x* 's elements and inserts them in order into **this*. The merge is stable; that is, if an element from **this* is equivalent to one from *x*, then the element from **this* will precede the one from *x*. All iterators to elements in **this* and *x* remain valid. This function is linear time: it performs at most *size() + x.size() – 1* applications of *Comp*. |

`void reverse();` |
Reverses the order of elements in the slist. All iterators remain valid and continue to point to the same elements. [6] This function is linear time. |

`void sort();` |
Sorts **this* according to *operator<*. The sort is stable, that is, the relative order of equivalent elements is preserved. All iterators remain valid and continue to point to the same elements. [7] The number of comparisons is approximately *N log N*, where *N* is the *slist* 's size. |

`template void sort(BinaryPredicate comp);` [5] |
*Comp* must be a comparison function that induces a strict weak ordering (as defined in the LessThan Comparable requirements) on objects of type *T*. This function sorts the slist **this* according to *Comp*. The sort is stable, that is, the relative order of equivalent elements is preserved. All iterators remain valid and continue to point to the same elements. [7] The number of comparisons is approximately *N log N*, where *N* is the *slist* 's size. |