public member function
Delete next element
Removes the next element in the queue
, effectively reducing its size
by one. The element removed is the "oldest" element in the queue
whose value can be retrieved by calling member queue::front
This calls the removed element's destructor.
This member function effectively calls the member function pop_front
of the underlying container object.
using namespace std;
int main ()
cout << "Please enter some integers (enter 0 to end):\n";
cin >> myint;
} while (myint);
cout << "myqueue contains: ";
cout << " " << myqueue.front();
The example uses push
to add a new elements to the queue, which are then popped out in the same order.
- Insert element (public member function)
- Test whether container is empty (public member function)