Original Post
I have a priority queue that I am adding nodes to... here is my code class Node { public: Node::Node(); Node::Node(int data, int weight); Node::Node(Node *leftChild, Node *rightChild); Node::~Node(); void Node::traverse(); bool operator > (const Node &n) const { return this->weight > n.weight; } public: int data; int weight; Node *leftChild; Node *rightChild; }; When I call the traverse() method on a node: tree.top().traverse(); I get a compile time error: error: passing ‘const Node’ as ‘this’ argument of ‘void Node::traverse()’ discards qualifiers