Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/container/priority queue"

From cppreference.com
< cpp‎ | container
(Grammar)
(+uses_allocator)
Line 48: Line 48:
 
{{dcl list begin}}
 
{{dcl list begin}}
 
{{dcl list template | cpp/container/dcl list std_swap | priority_queue}}
 
{{dcl list template | cpp/container/dcl list std_swap | priority_queue}}
 +
{{dcl list end}}
 +
 +
===Helper classes===
 +
{{dcl list begin}}
 +
{{dcl list template | cpp/container/dcl list uses_allocator | priority_queue}}
 
{{dcl list end}}
 
{{dcl list end}}

Revision as of 08:32, 1 November 2011

Template:cpp/container/priority queue/sidebar

Defined in header <queue>
template<

    class T,
    class Container = std::vector<T>,
    class Compare = std::less<typename Container::value_type>

> class priority_queue;

Priority queue is a container that allows for constant time maximum (or minimum, depending on Compare) extraction at the expense of logarithmic insertion. Working with a priority_queue is similar to managing a heap in some random access container, with the benefit of not being able to accidentally invalidate the heap.

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list end

Member functions

Template:cpp/container/dcl list constructorTemplate:cpp/container/dcl list destructorTemplate:cpp/container/dcl list operator=Template:cpp/container/dcl list topTemplate:cpp/container/dcl list emptyTemplate:cpp/container/dcl list sizeTemplate:cpp/container/dcl list pushTemplate:cpp/container/dcl list emplaceTemplate:cpp/container/dcl list popTemplate:cpp/container/dcl list swapTemplate:cpp/container/dcl list c
Element access
Capacity
Modifiers

Member objects

Non-member functions

Template:cpp/container/dcl list std swap

Helper classes

Template:cpp/container/dcl list uses allocator