Awesome. I got it with this. Thanks a bunch.

class leafcompare {
public:
bool operator()(const Leaf *p1, const Leaf *p2) const {
return p1->frequency > p2->frequency;
}
};

priority_queue<Leaf* , vector<Leaf*>, leafcompare> leaves;