deque.push_back( value ) : deque size « deque « C++ Tutorial






#include <iostream>
using std::cout;
using std::endl;

#include <deque>     // deque class-template definition
#include <algorithm> // copy algorithm
#include <iterator>  // ostream_iterator

int main()
{
   std::deque< double > values; // create deque of doubles
   std::ostream_iterator< double > output( cout, " " );

   values.push_front( 2.2 );
   values.push_front( 3.5 );
   values.push_back( 1.1 );

   cout << "values contains: ";
   // use subscript operator to obtain elements of values
   for ( int i = 0; i < values.size(); i++ )
      cout << values[ i ] << ' ';
   cout << endl;
   return 0;
}
values contains: 3.5 2.2 1.1








22.3.deque size
22.3.1.Resize a deque
22.3.2.deque.push_back( value )