/// The comparison function can be changed after creation by just calling [`MmHeap::ify_by`] again.
/// Rust's standard [`std::collections::BinaryHeap`] claims an `O(1)` average complexity for push,
/// This heap is also a binary heap so for a randomly ordered sequence it could also be considered `O(1)`,
/// but for this, the standard binary heap, and indeed any binary heap, the worst case insertion time
/// is `O(logn)`. Also, when a min (or minmax) heap is used to find the `m` largest elements in a large sequence of `n > m`
/// elements or visa versa, the expected cost of insertion drops from `1 - m/2^m` to ... even lower.
/// when changing the comparison function. When calling [`Self::push_by`] etc with the same comparison
for ii in [2*i + 2, 4*i + 3, 4*i + 4, 4*i + 5, 4*i + 6].into_iter().take_while(|&j|j<self.buf.len()) {
Some(slice_ref) => self.pop_idx_by(1 + slice_ref.into_iter().enumerate().max_by(|(_i,a),(_j,b)|cmp(a,b)).unwrap().0, cmp),
/// This is the same functionality provided by the [`Extend`] trait, except we need an additional
pub fn extend_by<U: IntoIterator<Item=T>>(&mut self, iter: U, cmp: &impl Fn(&T, &T) -> Ordering) {