![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
The intrusive priority_queue. By default, the priority_queue is building a max heap where the element at the top is always the largest. To build a min heap, pass a std::greater<> as the comparator.
More...
Public Types | |
| using | const_reference = T const& |
| const reference type | |
| using | reference = T& |
| reference type | |
| using | size_type = std::size_t |
| size type | |
| using | tag = Tag |
| tag type | |
| using | value_compare = Compare |
| value comparison type | |
| using | value_type = T |
| value type | |
Public Member Functions | |
| constexpr | priority_queue () noexcept=default |
| Construct an empty priority_queue. | |
| constexpr | priority_queue (priority_queue &&other) noexcept |
Move construct a priority_queue from another priority_queue. The other priority_queue will be empty after the move. | |
| priority_queue (priority_queue const &)=delete | |
| Deleted copy constructor. | |
| ~priority_queue ()=default | |
| Destructor. | |
| constexpr auto | empty () const noexcept -> bool |
Check whether the priority_queue is empty. | |
| constexpr void | erase (reference node) noexcept |
Erase a specific node from the priority_queue. | |
| constexpr auto | operator!= (priority_queue const &) const -> bool=delete |
| deleted equality operator | |
| constexpr auto | operator= (priority_queue &&other) noexcept -> priority_queue & |
Move assign a priority_queue from another priority_queue. The other priority_queue will be empty after the move. | |
| auto | operator= (priority_queue const &) -> priority_queue &=delete |
| Deleted copy constructor. | |
| constexpr auto | operator== (priority_queue const &) const -> bool=delete |
| deleted equality operator | |
| constexpr void | pop () noexcept |
Pop the top element from the priority_queue. | |
| constexpr void | push (reference value) noexcept |
Push an element to the priority_queue. | |
| constexpr auto | size () const noexcept -> size_type |
Return the number of elements in the priority_queue. | |
| constexpr void | swap (priority_queue &other) noexcept |
| Swap the contents of two priority queues. | |
| constexpr auto | top () const noexcept -> T & |
Return a reference to the top element of the priority_queue. | |
The intrusive priority_queue. By default, the priority_queue is building a max heap where the element at the top is always the largest. To build a min heap, pass a std::greater<> as the comparator.
| T | The type of the element. |
| Compare | The type of the comparator. Default to std::less<> |
| Tag | The tag of the priority queue to work on. Default to default_tag. |
| using arene::base::intrusive::priority_queue< T, Compare, Tag >::const_reference = T const& |
const reference type
| using arene::base::intrusive::priority_queue< T, Compare, Tag >::reference = T& |
reference type
| using arene::base::intrusive::priority_queue< T, Compare, Tag >::size_type = std::size_t |
size type
| using arene::base::intrusive::priority_queue< T, Compare, Tag >::tag = Tag |
tag type
| using arene::base::intrusive::priority_queue< T, Compare, Tag >::value_compare = Compare |
value comparison type
| using arene::base::intrusive::priority_queue< T, Compare, Tag >::value_type = T |
value type
|
explicitconstexprdefaultnoexcept |
Construct an empty priority_queue.
|
inlineconstexprnoexcept |
Move construct a priority_queue from another priority_queue. The other priority_queue will be empty after the move.
| other | The other priority_queue |
|
delete |
Deleted copy constructor.
Intrusive priority queue does not support copy
|
default |
Destructor.
|
inlineconstexprnoexcept |
Check whether the priority_queue is empty.
priority_queue is empty, false otherwise.
|
inlineconstexprnoexcept |
Erase a specific node from the priority_queue.
priority_queue. priority_queue must not be empty. | node | The node to be erased. |
|
constexprdelete |
deleted equality operator
Intrusive priority queue does not support equality comparison as the definition of equality is not clear for intrusive containers.
|
inlineconstexprnoexcept |
Move assign a priority_queue from another priority_queue. The other priority_queue will be empty after the move.
| other | The other priority_queue |
|
delete |
Deleted copy constructor.
Intrusive priority queue does not support copy
|
constexprdelete |
deleted equality operator
Intrusive priority queue does not support equality comparison as the definition of equality is not clear for intrusive containers.
|
inlineconstexprnoexcept |
Pop the top element from the priority_queue.
priority_queue must not be empty.
|
inlineconstexprnoexcept |
Push an element to the priority_queue.
priority_queue. | value | The element to be pushed. |
|
inlineconstexprnoexcept |
Return the number of elements in the priority_queue.
priority_queue.
|
inlineconstexprnoexcept |
Swap the contents of two priority queues.
| other | The queue to swap with. |
|
inlineconstexprnoexcept |
Return a reference to the top element of the priority_queue.