list

allocator_type · assign · back · begin · clear · const_iterator · const_reference · const_reverse_iterator · difference_type · empty · end · erase · front · get_allocator · insert · iterator · list · max_size · merge · pop_back · pop_front · push_back · push_front · rbegin · reference · remove · remove_if · rend · resize · reverse · reverse_iterator · size · size_type · sort · splice · swap · unique · value_type

template<class T, class A = allocator<T> >
    class list {
public:
    typedef A allocator_type;
    typedef A::size_type size_type;
    typedef A::difference_type difference_type;
    typedef A::reference reference;
    typedef A::const_reference const_reference;
    typedef A::value_type value_type;
    typedef T0 iterator;
    typedef T1 const_iterator;
    typedef reverse_bidirectional_iterator<iterator,
        value_type, reference, A::pointer,
            difference_type> reverse_iterator;
    typedef reverse_bidirectional_iterator<const_iterator,
        value_type, const_reference, A::const_pointer,
             difference_type> const_reverse_iterator;
    explicit list(const A& al = A());
    explicit list(size_type n, const T& v = T(), const A& al = A());
    list(const list& x);
    list(const_iterator first, const_iterator last,
        const A& al = A());
    iterator begin();
    const_iterator begin() const;
    iterator end();
    iterator end() const;
    reverse_iterator rbegin();
    const_reverse_iterator rbegin() const;
    reverse_iterator rend();
    const_reverse_iterator rend() const;
    void resize(size_type n, T x = T());
    size_type size() const;
    size_type max_size() const;
    bool empty() const;
    A get_allocator() const;
    reference front();
    const_reference front() const;
    reference back();
    const_reference back() const;
    void push_front(const T& x);
    void pop_front();
    void push_back(const T& x);
    void pop_back();
    void assign(const_iterator first, const_iterator last);
    void assign(size_type n, const T& x = T());
    iterator insert(iterator it, const T& x = T());
    void insert(iterator it, size_type n, const T& x);
    void insert(iterator it,
        const_iterator first, const_iterator last);
    void insert(iterator it,
        const T *first, const T *last);
    iterator erase(iterator it);
    iterator erase(iterator first, iterator last);
    void clear();
    void swap(list x);
    void splice(iterator it, list& x);
    void splice(iterator it, list& x, iterator first);
    void splice(iterator it, list& x, iterator first, iterator last);
    void remove(const T& x);
    void remove_if(binder2nd<not_equal_to<T> > pr);
    void unique();
    void unique(not_equal_to<T> pr);
    void merge(list& x);
    void merge(list& x, greater<T> pr);
    void sort();
    template<class Pred>
        void sort(greater<T> pr);
    void reverse();
protected:
    A allocator;
    };

The template class describes an object that controls a varying-length sequence of elements of type T. The sequence is stored as a bidirectional linked list of elements, each containing a member of type T.

The object allocates and frees storage for the sequence it controls through a protected object named allocator, of class A. Such an allocator object must have the same external interface as an object of template class allocator. Note that allocator is not copied when the object is assigned.

List reallocation occurs when a member function must insert or erase elements of the controlled sequence. In all such cases, only iterators or references that point at erased portions of the controlled sequence become invalid.