how to manipulate elements in the priority queue in boost C++
<p>I have a problem to deal with the pairing priority queues in boost C++. I have an item array {0,1,2,3,...}, and each item has a priority value. These priority queues construct another array {key0 for item 0, key1 for item 1, ...}.</p>

<p>In the algorithm, I need to select several items to put them in a priority queue. For example, I may select item 1, 2, 3 into a queue, ordered by their priority values (keys). Then, I need to remove a specific item. For example, I may want to remove item 2 from the queue of item 1, 2, 3, and item 2 may NOT have the maximal/minimal priority values.</p>

<p>Below is a queue I created using the pairing queue in boost.</p>

<pre><code>#include "stdafx.h"
#include &lt;iostream&gt;
#include &lt;boost/heap/pairing_heap.hpp&gt;
pairing_heap&lt;float&gt; pq;

pq.push(1);
pq.push(2.5);
auto handle = pq.push(3.1);
pq.erase(handle); // remove an element by handle
cout &lt;&lt; "pq top=" &lt;&lt; pq.top() &lt;&lt; endl; // a const_reference to the maximum element.
</code></pre>

<p>You can see that I can only push the priority values into the queue, and if I want to remove an item, I need to know its handle value. However, I don't know how to give handle values to a large amount of items. Hope there is someone who knows how to do it. Many thanks!</p>