Поделиться через


priority_queue::value_type

A type that represents the type of object stored as an element in a priority_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 priority_queue.

Example

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

int main( )
{
   using namespace std;

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

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

Requirements

Header: <queue>

Namespace: std

See Also

Reference

priority_queue Class

Standard Template Library