Extend heaps to allow removing arbitrary elements via an additional equality operator.