Copy constructor for a doubly linked list
<p>I am having problems making a copy constructor.
Consider the code below:</p>

<p>In List.h</p>

<pre><code>template &lt;class T&gt;
struct ListNode
{
    T value;
    ListNode&lt;T&gt; *next;
    ListNode&lt;T&gt; *prev;

    ListNode(T theVal)
    {
        this-&gt;value = theVal;
        this-&gt;next = NULL;
        this-&gt;prev = NULL;
    }
};

template &lt;class T&gt;
class List
{
    ListNode&lt;T&gt; *head;

public:
    List();
    List(const List&lt;T&gt;&amp; otherList); // Copy Constructor.
    ~List();
    };
</code></pre>

<p>In list.cpp</p>

<pre><code>template &lt;class T&gt;
List&lt;T&gt;::List()
{
    head=NULL;
}
template &lt;class T&gt;
List&lt;T&gt;::~List()
{
}
template &lt;class T&gt;
List&lt;T&gt;::List(const List&lt;T&gt;&amp; otherList)
{
}
</code></pre>

<p>//    I have google the problem. Concept is simple. Make a new head and assign its node the //values of old List node.
//    So for I have tried the following.</p>

<pre><code>ListNode&lt;T&gt; *old = head; // pointer to old list.
ListNode&lt;T&gt; *new;// pointer to new head.

while (old-&gt;next!=NULL){
new-&gt;value = old-&gt;value;
old = old-&gt;next; 
}
</code></pre>

<p>// The only problem is how to make a new head that would point to my new Copied list.</p>
