push_back

Syntax:

    #include <deque>
    void push_back( const TYPE& val );

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

     deque<int> dq;
     for( int i = 0; i < 10; i++ )
       dq.push_back( i );

When displayed, the resulting deque would look like this:

   0 1 2 3 4 5 6 7 8 9

push_back() runs in constant time.

Related Topics: assign, insert, pop_back, push_front