Priority Queue Not Comparing Correctly C++
<p>I am trying to create a priority queue consisting of pairs of int, char that gives me the pair with the greater int, but my code is not working properly. What am I doing wrong?</p>

<p>This is my comparator class:</p>

<pre><code>class Compare
{
public:
    bool operator() (pair&lt;int, char&gt;a, pair&lt;int, char&gt;b)
    {
        return a.first &gt; b.first;
    }
};
</code></pre>

<p>And this is my priority queue:</p>

<pre><code>priority_queue&lt;pair&lt;int, char&gt;, vector&lt;pair&lt;int, char&gt;&gt;, Compare&gt; party;
</code></pre>

<p>But if I execute the code:</p>

<pre><code>party.push(make_pair(2, 'A'));
party.push(make_pair(3, 'B'));
cout&lt;&lt;party.top().first;
</code></pre>

<p>It returns 2, instead of 3. How do I fix my implementation of the priority queue?</p>