Share via


queue::value_type

A type that represents the type of object stored as an element in a queue.

typedef typename Container::value_type value_type;

Remarks

The type is a synonym for the value_type of the base container adapted by the queue.

Example

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

int main( )
{
using namespace std;

   // Declares queues with default deque base container
   queue<int>::value_type AnInt;
   
   AnInt = 69;
   cout << "The value_type is AnInt = " << AnInt << endl;

   queue<int> q1;
   q1.push(AnInt);
   cout << "The element at the front of the queue is "
        << q1.front( ) << "." << endl;
}
The value_type is AnInt = 69
The element at the front of the queue is 69.

Requirements

Header: <queue>

Namespace: std

See Also

Reference

queue Class

Standard Template Library