BinaryHeap.conditionalInsert

If the heap has room to grow, inserts value into the store and returns true. Otherwise, if less(value, front), calls replaceFront(value) and returns again true. Otherwise, leaves the heap unaffected and returns false. This method is useful in scenarios where the smallest k elements of a set of candidates must be collected.

struct BinaryHeap(alias less = "a < b", Store)
scope
bool
conditionalInsert
(
ElementType!Store value
)
if (
isRandomAccessRange!Store ||
isRandomAccessRange!(typeof(Store.init[]))
)

Meta