iterator

operator fun iterator(): Heap<T>

Returns a destructive iterator over the contents of this heap.

Example:

val heap = heapOf(1, 2, 3) { a, b -> a b }

for (item in heap)
println(item)

Return

This heap instance as an iterator.