__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc > Class Template Reference
Extensions » Policy-Based Data Structures » Containers » Heap-Based

`#include <priority_queue.hpp>`

Inherits detail::container_base_dispatch::type.

## Public Types

typedef _Alloc | allocator_type
typedef Cmp_Fn | cmp_fn
typedef base_type::const_iterator | const_iterator
typedef __rebind_va::const_pointer | const_pointer
typedef __rebind_va::const_reference | const_reference
typedef Tag | container_category
typedef allocator_type::difference_type | difference_type
typedef base_type::iterator | iterator
typedef base_type::point_const_iterator | point_const_iterator
typedef base_type::point_iterator | point_iterator
typedef __rebind_va::pointer | pointer
typedef __rebind_va::reference | reference
typedef allocator_type::size_type | size_type
typedef _Tv | value_type

## Public Member Functions

| priority_queue (const cmp_fn &r_cmp_fn)
| priority_queue (const priority_queue &other)
template<typename It >
| priority_queue (It first_it, It last_it)
template<typename It >
| priority_queue (It first_it, It last_it, const cmp_fn &r_cmp_fn)
priority_queue & | operator= (const priority_queue &other)
void | swap (priority_queue &other)

## Detailed Description

template<typename _Tv, typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>
class __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >

A priority queue composed of one specific heap policy.

Template Parameters

  _Tv | Value type.
  Cmp_Fn | Comparison functor.
  Tag | Instantiating data structure type, see container_tag.
  _Alloc | Allocator type.

Base is dispatched at compile time via Tag, from the following choices: binary_heap_tag, binomial_heap_tag, pairing_heap_tag, rc_binomial_heap_tag, thin_heap_tag

Base choices are: detail::binary_heap, detail::binomial_heap, detail::pairing_heap, detail::rc_binomial_heap, detail::thin_heap.

Definition at line 84 of file priority_queue.hpp.

## Member Typedef Documentation

## allocator_type

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef _Alloc __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::allocator_type

Definition at line 91 of file priority_queue.hpp.

## cmp_fn

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef Cmp_Fn __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::cmp_fn

Definition at line 89 of file priority_queue.hpp.

## const_iterator

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef base_type::const_iterator __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::const_iterator

Definition at line 111 of file priority_queue.hpp.

## const_pointer

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef __rebind_va::const_pointer __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::const_pointer

Definition at line 106 of file priority_queue.hpp.

## const_reference

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef __rebind_va::const_reference __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::const_reference

Definition at line 104 of file priority_queue.hpp.

## container_category

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef Tag __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::container_category

Definition at line 90 of file priority_queue.hpp.

## difference_type

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef allocator_type::difference_type __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::difference_type

Definition at line 93 of file priority_queue.hpp.

## iterator

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef base_type::iterator __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::iterator

Definition at line 110 of file priority_queue.hpp.

## point_const_iterator

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef base_type::point_const_iterator __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::point_const_iterator

Definition at line 109 of file priority_queue.hpp.

## point_iterator

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef base_type::point_iterator __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::point_iterator

Definition at line 108 of file priority_queue.hpp.

## pointer

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef __rebind_va::pointer __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::pointer

Definition at line 105 of file priority_queue.hpp.

## reference

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef __rebind_va::reference __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::reference

Definition at line 103 of file priority_queue.hpp.

## size_type

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef allocator_type::size_type __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::size_type

Definition at line 92 of file priority_queue.hpp.

## value_type

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

typedef _Tv __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::value_type

Definition at line 88 of file priority_queue.hpp.

## Constructor & Destructor Documentation

## priority_queue() [1/5]

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::priority_queue | ( |  | ) |

inline

Definition at line 113 of file priority_queue.hpp.

## priority_queue() [2/5]

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::priority_queue | ( | const cmp_fn & | r_cmp_fn | ) |

inline

Constructor taking some policy objects. r_cmp_fn will be copied by the Cmp_Fn object of the container object.

Definition at line 117 of file priority_queue.hpp.

## priority_queue() [3/5]

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>
template<typename It >

__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::priority_queue | ( | It | first_it,
|  | It | last_it
| ) |  |

inline

Constructor taking __iterators to a range of value_types. The value_types between first_it and last_it will be inserted into the container object.

Definition at line 123 of file priority_queue.hpp.

## priority_queue() [4/5]

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>
template<typename It >

__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::priority_queue | ( | It | first_it,
|  | It | last_it,
|  | const cmp_fn & | r_cmp_fn
| ) |  |

inline

Constructor taking __iterators to a range of value_types and some policy objects The value_types between first_it and last_it will be inserted into the container object. r_cmp_fn will be copied by the cmp_fn object of the container object.

Definition at line 131 of file priority_queue.hpp.

## priority_queue() [5/5]

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::priority_queue | ( | const priority_queue< _Tv, Cmp_Fn, Tag, _Alloc > & | other | ) |

inline

Definition at line 135 of file priority_queue.hpp.

## ~priority_queue()

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

virtual __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::~priority_queue | ( |  | ) |

inline virtual

Definition at line 139 of file priority_queue.hpp.

## Member Function Documentation

## operator=()

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

priority_queue & __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::operator= | ( | const priority_queue< _Tv, Cmp_Fn, Tag, _Alloc > & | other | ) |

inline

Definition at line 142 of file priority_queue.hpp.

## swap()

template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag = pairing_heap_tag, typename _Alloc = std::allocator<char>>

void __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::swap | ( | priority_queue< _Tv, Cmp_Fn, Tag, _Alloc > & | other | ) |

inline

Definition at line 153 of file priority_queue.hpp.

The documentation for this class was generated from the following file:

- priority_queue.hpp