title: Operator Overloading for Queue C++
body: <p>I was trying to use the overload operator method to copy the entries of one queue into another, but I am going wrong with my function. I don't know how else to access the values of the queue "original" any other way than what I have below:</p>
  
  <pre><code>struct Node
  {
     int item;
     Node* next;
  };
  
  class Queue
  {
  public:
      // Extra code here
      void operator = (const Queue &amp;original);
  protected:
      Node *front, *end;
  };
  
  void Queue::operator=(const Queue &amp;original)
  {
      //THIS IS WHERE IM GOING WRONG
      while(original.front-&gt;next != NULL) {
          front-&gt;item = original.front-&gt;item;
          front-&gt;next = new Node;
          front = front-&gt;next;
          original.front = original.front-&gt;next;
      }
  }
  </code></pre>