Fixed-capacity statically-allocated binary min-heap. Zero dynamic heap allocations.
More...
|
| void | clear () noexcept |
| | Clear all elements.
|
| |
| const T * | data () const noexcept |
| | Direct const access to underlying data array.
|
| |
| T * | data () noexcept |
| | Direct access to underlying data array.
|
| |
| constexpr bool | empty () const noexcept |
| | Check if heap is empty.
|
| |
| constexpr bool | full () const noexcept |
| | Check if heap is full.
|
| |
| bool | pop () noexcept |
| | Remove the top element from the heap.
|
| |
| template<typename U > |
| bool | push (U &&value) |
| | Push an element into the heap.
|
| |
| void | siftDown (std::size_t index) noexcept |
| | Sift down an element at specified index (e.g. after in-place modification).
|
| |
| void | siftUp (std::size_t index) noexcept |
| | Sift up an element at specified index.
|
| |
| constexpr std::size_t | size () const noexcept |
| | Current number of elements in the heap.
|
| |
| constexpr | StaticMinHeap ()=default |
| |
| const T & | top () const noexcept |
| | Access top element.
|
| |
| T & | top () noexcept |
| | Access mutable top element.
|
| |
template<typename T, std::size_t Capacity, typename Compare = std::greater<T>>
class corium::internal::StaticMinHeap< T, Capacity, Compare >
Fixed-capacity statically-allocated binary min-heap. Zero dynamic heap allocations.
- Template Parameters
-
| T | Element type stored in the heap. |
| Capacity | Maximum number of elements. |
| Compare | Comparator predicate (std::greater<T> for min-heap where smallest element is at top). |