C++ code explain?
<p>I am learning C++ from a book and there is 1 line of code which I do not understand.  The program should simulate a queue of people in front of an ATM. I do not understand this one line:</p>

<pre><code>item = front-&gt;item; // Is it necessary and what does it do ?
</code></pre>

<p>It is at the end in <code>bool Queue::dequeue(Item &amp; item)</code>. It has to do something with a pointer, but when I delete this line, the program works just fine.</p>

<p>Here is the important part of the code:</p>

<pre><code>class Customer
{
private:
    long arrive; 
    int processtime;
public:
    Customer() { arrive = processtime = 0; }
    void set(long when);
    long when() const { return arrive; }
    int ptime() const { return processtime; }
};

typedef Customer Item;

class Queue
{
private:
    struct Node { Item item; struct Node * next; };
    enum { Q_SIZE = 10 };
    Node * front; 
    Node * rear; 
    int items; 
    const int qsize;
    Queue(const Queue &amp; q) : qsize(0) { }
    Queue &amp; operator=(const Queue &amp; q) { return *this; }
public:
    Queue(int qs = Q_SIZE); 
    ~Queue();
    bool isempty() const;
    bool isfull() const;
    int queuecount() const;
    bool enqueue(const Item &amp;item); 
    bool dequeue(Item &amp;item); 
};

Queue::Queue(int qs) : qsize(qs)
{
    front = rear = NULL;
    items = 0;
}

Queue::~Queue()
{
    Node * temp;
    while (front != NULL) 
    {
        temp = front; 
        front = front-&gt;next; 
        delete temp; 
    }
}

bool Queue::enqueue(const Item &amp; item)
{
    if (isfull())
        return false;
    Node * add = new Node; 
    if (add == NULL)
        return false; 
    add-&gt;item = item; 
    add-&gt;next = NULL;
    items++;
    if (front == NULL) 
        front = add; 
    else
        rear-&gt;next = add; 
    rear = add; 
    return true;
}

bool Queue::dequeue(Item &amp; item)
{
    if (front == NULL)
        return false;
    item = front-&gt;item; // Is it necessary and what does it do ?
    items--;
    Node * temp = front; 
    front = front-&gt;next; 
    delete temp; 
    if (items == 0)
        rear = NULL;
    return true;
}
</code></pre>