bug fixed: sort method will lost value for some datas.
test case:
typedef std::pair<uint32_t, double> Elem;
bool elem_cmp(Elem const& parent, Elem const& child)
{
    return (parent.second < child.second);
}
    Heap<Elem, elem_cmp> hp(10);
    hp.insert(std::make_pair( 5237, 0.52708862178249616));
    hp.insert(std::make_pair(  663, 0.53072930435083121));
    hp.insert(std::make_pair( 1338, 0.54786771244760135));
    hp.insert(std::make_pair(21703, 0.54683336500056656));
    hp.insert(std::make_pair(41225, 0.56631348204263099));
    hp.insert(std::make_pair( 3574, 0.55793189242459440));
    hp.insert(std::make_pair(  949, 0.55902915584177904));
    hp.insert(std::make_pair( 2989, 0.58548811045438542));
    hp.insert(std::make_pair( 6728, 0.53715224365966319));
    hp.insert(std::make_pair( 2233, 0.57786727560545004));
    hp.sort();
bug: when running this code ( 3574, 0.55793189242459440) will lost.