a generic heap implemented in c++ template.