Standard C++ Library Class Reference

splice (iterator position, list<T, Allocator>& x);
Inserts x before position leaving x empty.
void
splice (iterator position, list<T, Allocator>& x, iterator i);
Moves the elements pointed to by iterator i in x to self, inserting it before position. The element is
removed from x.
void
splice (iterator position, list<T, Allocator >& x,
iterator first, iterator last);
Moves the elements in the range [first, last) in x to self, inserting before position. The elements in the
range [first, last) are removed from x.
void
swap (list <T, Allocator>& x);
Exchanges self with x.
void
unique ();
Erases copies of consecutive repeated elements leaving the first occurrrence.
template <class BinaryPredicate>
void
unique (BinaryPredicate binary_pred);
Erases consecutive elements matching a true condition of the binary_pred. The first occurrence is not
removed.
Non-member Operators
template <class T, class Allocator>
bool operator== (const list<T, Allocator>& x,
const list<T, Allocator>& y);
Equality operator. Returns true if x is the same as y.
template <class T, class Allocator>
bool operator< (const list<T, Allocator>& x,
const list<T,Allocator>& y);
Returns true if the sequence defined by the elements contaned in x is lexicographically less than the
sequence defined by the elements contained in y.
template <class T, class Allocator>
void swap (list<T, Allocator>& a, list<T, Allocator>& b);
Efficiently swaps the contents of a and b.
Example
//
// list.cpp
//
#include <list>