<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://cppreference.com/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://cppreference.com/wiki/feed.php">
        <title>C++ Reference stl:list</title>
        <description></description>
        <link>http://cppreference.com/wiki/</link>
        <image rdf:resource="http://cppreference.com/wiki/lib/images/favicon.ico" />
       <dc:date>2010-09-09T09:17:33-07:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/assign?rev=1279248735&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/back?rev=1248763786&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/begin?rev=1233601652&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/clear?rev=1224024126&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/empty?rev=1248467279&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/end?rev=1276217890&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/erase?rev=1276203164&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/front?rev=1224024126&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/insert?rev=1271780393&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/list_constructors?rev=1255186001&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/list_operators?rev=1255088145&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/max_size?rev=1248772849&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/merge?rev=1255188211&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/pop_back?rev=1276542668&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/pop_front?rev=1224024126&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/push_back?rev=1224024126&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/push_front?rev=1224024126&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/rbegin?rev=1255188307&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/remove?rev=1262629739&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/remove_if?rev=1233938146&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/rend?rev=1248488759&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/resize?rev=1255090739&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/reverse?rev=1224024126&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/size?rev=1224024126&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/sort?rev=1255188540&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/splice?rev=1249277812&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/start?rev=1281175954&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/swap?rev=1255088859&amp;do=diff"/>
                <rdf:li rdf:resource="http://cppreference.com/wiki/stl/list/unique?rev=1224024126&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://cppreference.com/wiki/lib/images/favicon.ico">
        <title>C++ Reference</title>
        <link>http://cppreference.com/wiki/</link>
        <url>http://cppreference.com/wiki/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="http://cppreference.com/wiki/stl/list/assign?rev=1279248735&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-07-15T19:52:15-07:00</dc:date>
        <title>assign</title>
        <link>http://cppreference.com/wiki/stl/list/assign?rev=1279248735&amp;do=diff</link>
        <description>assign

Syntax:

    #include &lt;list&gt;
    void assign( size_type num, const TYPE&amp; val );
    void assign( input_iterator start, input_iterator end );

The assign() function either gives the current list the values from start to
end, or gives it num copies of val.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/back?rev=1248763786&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-07-27T23:49:46-07:00</dc:date>
        <title>back</title>
        <link>http://cppreference.com/wiki/stl/list/back?rev=1248763786&amp;do=diff</link>
        <description>back

Syntax:

    #include &lt;list&gt;
    TYPE&amp; back();
    const TYPE&amp; back() const;

The back() function returns a reference to the last element in the list.

For example:

   list&lt;int&gt; l;
   for( int i = 0; i &lt; 5; i++ ) {
     l.push_back(i);
   }
   cout &lt;&lt; &quot;The first element is &quot; &lt;&lt; l.front()
        &lt;&lt; &quot; and the last element is &quot; &lt;&lt; l.back() &lt;&lt; endl;</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/begin?rev=1233601652&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-02-02T11:07:32-07:00</dc:date>
        <title>begin</title>
        <link>http://cppreference.com/wiki/stl/list/begin?rev=1233601652&amp;do=diff</link>
        <description>begin

Syntax:

    #include &lt;list&gt;
    iterator begin();
    const_iterator begin() const;

The function begin() returns an iterator to the first element of the list.
begin() should run in constant time.

For example, the following code uses begin() to initialize an iterator that is
used to traverse a list:</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/clear?rev=1224024126&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-14T15:42:06-07:00</dc:date>
        <title>clear</title>
        <link>http://cppreference.com/wiki/stl/list/clear?rev=1224024126&amp;do=diff</link>
        <description>clear

Syntax:

    #include &lt;list&gt;
    void clear();

The function clear() deletes all of the elements in the list. clear() runs in
linear time.

Related Topics: erase</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/empty?rev=1248467279&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-07-24T13:27:59-07:00</dc:date>
        <title>empty</title>
        <link>http://cppreference.com/wiki/stl/list/empty?rev=1248467279&amp;do=diff</link>
        <description>empty

Syntax:

    #include &lt;list&gt;
    bool empty() const;

The empty() function returns true if the list has no elements, false
otherwise.  For example, the following code uses empty() as the
stopping condition on a while loop to clear a list and
display its contents in reverse order:</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/end?rev=1276217890&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-06-10T17:58:10-07:00</dc:date>
        <title>end</title>
        <link>http://cppreference.com/wiki/stl/list/end?rev=1276217890&amp;do=diff</link>
        <description>end

Syntax:

    #include &lt;list&gt;
    iterator end();
    const_iterator end() const;

The end() function returns an iterator just past the end of the list.

Note that before you can access the last element of the list using an iterator
that you get from a call to end(), you'll have to decrement the iterator first.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/erase?rev=1276203164&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-06-10T13:52:44-07:00</dc:date>
        <title>erase</title>
        <link>http://cppreference.com/wiki/stl/list/erase?rev=1276203164&amp;do=diff</link>
        <description>erase

Syntax:

    #include &lt;list&gt;
    iterator erase( iterator loc );
    iterator erase( iterator start, iterator end );

The erase method either deletes the element at location loc, or deletes the elements between start and end (including start but not including end). The return value is the element after the last element erased.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/front?rev=1224024126&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-14T15:42:06-07:00</dc:date>
        <title>front</title>
        <link>http://cppreference.com/wiki/stl/list/front?rev=1224024126&amp;do=diff</link>
        <description>front

Syntax:

    #include &lt;list&gt;
    TYPE&amp; front();
    const TYPE&amp; front() const;

The front() function returns a reference to the first element of the list, and
runs in constant time.

Related Topics: back, pop_front, push_front</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/insert?rev=1271780393&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-04-20T09:19:53-07:00</dc:date>
        <title>insert</title>
        <link>http://cppreference.com/wiki/stl/list/insert?rev=1271780393&amp;do=diff</link>
        <description>insert

Syntax:

    #include &lt;list&gt;
    iterator insert( iterator loc, const TYPE&amp; val );
    void insert( iterator loc, size_type num, const TYPE&amp; val );
    void insert( iterator loc, input_iterator start, input_iterator end );

The insert() function either:</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/list_constructors?rev=1255186001&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-10T07:46:41-07:00</dc:date>
        <title>List constructors</title>
        <link>http://cppreference.com/wiki/stl/list/list_constructors?rev=1255186001&amp;do=diff</link>
        <description>List constructors

Syntax:

    #include &lt;list&gt;
    list();
    list( const list&amp; c );
    explicit list( size_type num, const TYPE&amp; val = TYPE() );
    list( input_iterator start, input_iterator end );
    ~list();

The default list constructor takes no arguments, creates a new instance of that
list.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/list_operators?rev=1255088145&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-09T04:35:45-07:00</dc:date>
        <title>List operators</title>
        <link>http://cppreference.com/wiki/stl/list/list_operators?rev=1255088145&amp;do=diff</link>
        <description>List operators

Syntax:

    #include &lt;list&gt;
    list&amp; operator=(const list&amp; c2);
    bool operator==(const list&amp; c1, const list&amp; c2);
    bool operator!=(const list&amp; c1, const list&amp; c2);
    bool operator&lt;(const list&amp; c1, const list&amp; c2);
    bool operator&gt;(const list&amp; c1, const list&amp; c2);
    bool operator&lt;=(const list&amp; c1, const list&amp; c2);
    bool operator&gt;=(const list&amp; c1, const list&amp; c2);</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/max_size?rev=1248772849&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-07-28T02:20:49-07:00</dc:date>
        <title>max_size</title>
        <link>http://cppreference.com/wiki/stl/list/max_size?rev=1248772849&amp;do=diff</link>
        <description>max_size

Syntax:

    #include &lt;list&gt;
    size_type max_size() const;

The max_size() function returns the maximum number of elements that
the list can hold. The max_size() function should not be confused with
the size function, which return the number of
elements currently in the list.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/merge?rev=1255188211&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-10T08:23:31-07:00</dc:date>
        <title>merge</title>
        <link>http://cppreference.com/wiki/stl/list/merge?rev=1255188211&amp;do=diff</link>
        <description>merge

Syntax:

    #include &lt;list&gt;
    void merge( list&amp; other );
    void merge( list&amp; other, BinPred compfunction );

The function merge() merges all elements of other into *this, making other empty. The resulting list is ordered with respect to the &lt; operator. If compfunction is specified, then
it is used as the comparison function for the lists instead of &lt;.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/pop_back?rev=1276542668&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-06-14T12:11:08-07:00</dc:date>
        <title>pop_back</title>
        <link>http://cppreference.com/wiki/stl/list/pop_back?rev=1276542668&amp;do=diff</link>
        <description>pop_back

Syntax:

    #include &lt;list&gt;
    void pop_back();

The pop_back method removes the last element of the list.

pop_back runs in constant time.

Related Topics: back, erase, pop_front, push_back</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/pop_front?rev=1224024126&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-14T15:42:06-07:00</dc:date>
        <title>pop_front</title>
        <link>http://cppreference.com/wiki/stl/list/pop_front?rev=1224024126&amp;do=diff</link>
        <description>pop_front

Syntax:

    #include &lt;list&gt;
    void pop_front();

The function pop_front() removes the first element of the list.

The pop_front() function runs in constant time.

Related Topics: erase, front, pop_back, push_front</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/push_back?rev=1224024126&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-14T15:42:06-07:00</dc:date>
        <title>push_back</title>
        <link>http://cppreference.com/wiki/stl/list/push_back?rev=1224024126&amp;do=diff</link>
        <description>push_back

Syntax:

    #include &lt;list&gt;
    void push_back( const TYPE&amp; val );

The push_back() function appends val to the end of the list.
For example, the following code puts 10 integers into a list:

     list&lt;int&gt; the_list;
     for( int i = 0; i &lt; 10; i++ )
       the_list.push_back( i );</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/push_front?rev=1224024126&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-14T15:42:06-07:00</dc:date>
        <title>push_front</title>
        <link>http://cppreference.com/wiki/stl/list/push_front?rev=1224024126&amp;do=diff</link>
        <description>push_front

Syntax:

    #include &lt;list&gt;
    void push_front( const TYPE&amp; val );

The push_front() function inserts val at the beginning of list.

push_front() runs in constant time.

Related Topics: assign, front, insert, pop_front, push_back</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/rbegin?rev=1255188307&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-10T08:25:07-07:00</dc:date>
        <title>rbegin</title>
        <link>http://cppreference.com/wiki/stl/list/rbegin?rev=1255188307&amp;do=diff</link>
        <description>rbegin

Syntax:

    #include &lt;list&gt;
    reverse_iterator rbegin();
    const_reverse_iterator rbegin() const;

The rbegin() function returns a reverse_iterator to the end of the current
list (the position of the last element).

rbegin() runs in constant time.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/remove?rev=1262629739&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-01-04T10:28:59-07:00</dc:date>
        <title>remove</title>
        <link>http://cppreference.com/wiki/stl/list/remove?rev=1262629739&amp;do=diff</link>
        <description>remove

Syntax:

    #include &lt;list&gt;
    void remove( const TYPE &amp;val );

The function remove() removes all elements that are equal to val from the list.
For example, the following code creates a list of the first 10 characters of
the alphabet, then uses remove() to remove the letter 'E' from the list:</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/remove_if?rev=1233938146&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-02-06T08:35:46-07:00</dc:date>
        <title>remove_if</title>
        <link>http://cppreference.com/wiki/stl/list/remove_if?rev=1233938146&amp;do=diff</link>
        <description>remove_if

Syntax:

    #include &lt;list&gt;
    void remove_if( UnPred pr );

The remove_if() function removes all elements from the list for which the unary
predicate pr is true.

remove_if() runs in linear time.

Related Topics: erase, remove, unique</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/rend?rev=1248488759&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-07-24T19:25:59-07:00</dc:date>
        <title>rend</title>
        <link>http://cppreference.com/wiki/stl/list/rend?rev=1248488759&amp;do=diff</link>
        <description>rend

Syntax:

    #include &lt;list&gt;
    reverse_iterator rend();
    const_reverse_iterator rend() const;

The function rend() returns a reverse_iterator to an element just before the first element of the current
list.

rend() runs in constant time.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/resize?rev=1255090739&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-09T05:18:59-07:00</dc:date>
        <title>resize</title>
        <link>http://cppreference.com/wiki/stl/list/resize?rev=1255090739&amp;do=diff</link>
        <description>resize

Syntax:

    #include &lt;list&gt;
    void resize( size_type size, TYPE val = TYPE() );

The resize method changes the size of the list to size. If val is specified
then any newly-created elements will be initialized to have a value of val.

This function runs in linear time.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/reverse?rev=1224024126&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-14T15:42:06-07:00</dc:date>
        <title>reverse</title>
        <link>http://cppreference.com/wiki/stl/list/reverse?rev=1224024126&amp;do=diff</link>
        <description>reverse

Syntax:

    #include &lt;list&gt;
    void reverse();

The function reverse() reverses the list, and takes linear time.

Related Topics: sort</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/size?rev=1224024126&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-14T15:42:06-07:00</dc:date>
        <title>size</title>
        <link>http://cppreference.com/wiki/stl/list/size?rev=1224024126&amp;do=diff</link>
        <description>size

Syntax:

    #include &lt;list&gt;
    size_type size() const;

The size() function returns the number of elements in the current list.

Related Topics: empty, max_size, resize</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/sort?rev=1255188540&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-10T08:29:00-07:00</dc:date>
        <title>sort</title>
        <link>http://cppreference.com/wiki/stl/list/sort?rev=1255188540&amp;do=diff</link>
        <description>sort

Syntax:

    #include &lt;list&gt;
    void sort();
    void sort( BinPred p );

The sort() function is used to sort lists into ascending order. Ordering is
done via the &lt; operator, unless p is specified, in which case it is used to
determine if an element is less than another.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/splice?rev=1249277812&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-08-02T22:36:52-07:00</dc:date>
        <title>splice</title>
        <link>http://cppreference.com/wiki/stl/list/splice?rev=1249277812&amp;do=diff</link>
        <description>splice

Syntax:

    #include &lt;list&gt;
    void splice( iterator pos, list&amp; lst );
    void splice( iterator pos, list&amp; lst, iterator del );
    void splice( iterator pos, list&amp; lst, iterator start, iterator end );

The splice function moves one or more items from lst right before location pos. The first overloading moves all items to lst, the second moves just the item at del, and the third moves all items in the range inclusive of start and exclusive of end.</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/start?rev=1281175954&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-08-07T03:12:34-07:00</dc:date>
        <title>C++ Lists</title>
        <link>http://cppreference.com/wiki/stl/list/start?rev=1281175954&amp;do=diff</link>
        <description>Lists are sequences of elements stored in a linked list. Compared to
vectors, they allow fast insertions and deletions, but
no random access.

Constructorscreate lists and initialize them with some dataOperatorsassign and compare listsassignassign elements to a listbackreturns a reference to last element of a listbeginreturns an iterator to the beginning of the listclearremoves all elements from the listemptytrue if the list has no elementsendreturns an iterator just past the last element of a l…</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/swap?rev=1255088859&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-09T04:47:39-07:00</dc:date>
        <title>swap</title>
        <link>http://cppreference.com/wiki/stl/list/swap?rev=1255088859&amp;do=diff</link>
        <description>swap

Syntax:

    #include &lt;list&gt;
    void swap( list&amp; from );

The swap() function exchanges the elements of the current list with those of
from. This function operates in constant time.

For example, the following code uses the swap() function to exchange the values
of two lists:</description>
    </item>
    <item rdf:about="http://cppreference.com/wiki/stl/list/unique?rev=1224024126&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-14T15:42:06-07:00</dc:date>
        <title>unique</title>
        <link>http://cppreference.com/wiki/stl/list/unique?rev=1224024126&amp;do=diff</link>
        <description>unique

Syntax:

    #include &lt;list&gt;
    void unique();
    void unique( BinPred pr );

The function unique() removes all consecutive duplicate elements from the list.

Note that only consecutive duplicates are removed, which may require that you
sort() the list first.</description>
    </item>
</rdf:RDF>
