ZXFoundation™ 26h2
Loading...
Searching...
No Matches
lib.min_heap Module Reference

Data Structures

struct  lib::min_heap< T, Capacity >
 Fixed-capacity binary min-heap. More...

Functions

constexpr auto empty () const noexcept -> bool
 Whether the heap is empty.
constexpr auto peek () const noexcept -> T
 Peek at the minimum element without removing it.
template<typename Less>
auto pop (Less less) noexcept -> void
 Remove the minimum element.
template<typename Less>
auto push (T elem, Less less) noexcept -> bool
 Insert an element, maintaining the heap invariant.
template<typename Less>
auto remove (T elem, Less less) noexcept -> bool
 Remove a specific element by linear scan.
constexpr auto size () const noexcept -> u32
 Number of elements in the heap.

Variables

entries [Capacity] {}
u32 m_count {0}

Files

file  lib/min_heap.cxxm
 Generic intrusive binary min-heap with fixed capacity.