queue::push

Fügt ein Element der umgekehrten der Warteschlange hinzu.

void push(
   const Type& val
);

Parameter

  • val
    Das Element hinzugefügte wieder der Warteschlange.

Hinweise

Die Umkehrung der Warteschlange ist die Position, die zuletzt vom hinzugefügte Element eingenommen wurde und das letzte Element am Ende des Containers.

Beispiel

// queue_push.cpp
// compile with: /EHsc
#include <queue>
#include <iostream>

int main( )
{
   using namespace std;
   queue <int> q1;

   q1.push( 10 );
   q1.push( 20 );
   q1.push( 30 );

   queue <int>::size_type i;
   i = q1.size( );
   cout << "The queue length is " << i << "." << endl;

   i = q1.front( );
   cout << "The element at the front of the queue is "
        << i << "." << endl;
}
  
  

Anforderungen

Header: <queue>

Namespace: std

Siehe auch

Referenz

queue Class

queue Functions

Standardvorlagenbibliothek