STL Minimum Priority Queue Question

Dec 3, 2012 at 2:23am
I am trying to create a MINIMUM priority queue by using C++ STL's. What I want is it to be ordered from smallest to largest (min pq), using an int. What I also want is to have a pointer to a Class I created associated with it. So, when I pop values off the queue, I pop a pointer to that class rather than the integer itself.

I am just unfamiliar with the the syntax of the STL priority_queue. Can anyone help me with that?

Here's what I was trying:

priority_queue<int, vector<Node*>, greater<Node*> > mpq;

But I still cannot figure out how to push and return pointers to and from the queue while using an integer as the comparison value.
Last edited on Dec 3, 2012 at 2:55am
Topic archived. No new replies allowed.