heaps template