how to overload > operator for a queue
<p>i have a priority queue and i have defined like this:</p>

<pre><code>priority_queue&lt;Node*,vector&lt;Node*&gt;,greater&lt;Node*&gt;&gt; myQueue;
</code></pre>

<p>i have to add to queue on the basis of a parameter param and i have overloaded it like this</p>

<pre><code>bool Node::operator&gt;(const Node&amp; right) const
{   
    return param&gt;right.param;
}
</code></pre>

<p>since the overload function doesnt take a pointer object, how should i change it so that my overloaded function is called.
i am adding to queue this way:</p>

<pre><code>Node *myNode
myQueue.add(myNode);
</code></pre>

<p>i cant pass the myNode without making as pointer object.
please guide ..</p>

<p>@Sellibitze
i have done something like this </p>

<pre><code>    template&lt;typename Node, typename Cmp = std::greater&lt;Node&gt; &gt;
struct deref_compare : std::binary_function&lt;Node*,Node*,bool&gt;
{
    deref_compare(Cmp const&amp; cmp = Cmp())
    : cmp(cmp) {}

    bool operator()(Node* a, Node* b) const {
        return cmp(*a,*b);
    }

private:
    Cmp cmp;
};

typedef deref_compare&lt;Node,std::greater&lt;Node&gt; &gt; my_comparator_t;
priority_queue&lt;Node*,vector&lt;Node*&gt;,my_comparator_t&gt; open;
</code></pre>

<p>i am filled with errors. </p>
