Original Post
I have an STL priority queue full of nodes. These nodes have data in them, but I need to change some of that data after adding the node to the priority queue. Specifically, I am doing huffman compression and want to save the huffman code within each node. This can only be done after traversing the tree to each leaf node and then (hopefully) saving the code within the node. Only problem is that top() returns a const reference to the node. Any way to get around this? Thanks.