Universal Set Class - Copy Constructor
<p>Afternoon, guys and gals. </p>

<p>So I'm working on a universal set at the moment, trying to get my copy constructor to work. I have a node class finished. I'm at the point where everything seems to make sense to me, but it's still not working..</p>

<p><em>Granted, I'm still having issues wrapping my head around linked lists.</em></p>

<pre><code>template&lt;class T&gt;
set&lt;T&gt;::set(const set&lt;T&gt; &amp; other) {
    if(other.head == NULL) { head = NULL; }
    else {
        node &lt;T&gt; * s_ptr;
        node &lt;T&gt; * d_ptr;
        head = new node;
        head -&gt; get_data() = other.head -&gt; get_data();
        s_ptr = other.head -&gt; set_link();
        d_ptr = head;

        while (s_ptr != NULL) {
            d_ptr -&gt; set_link() = new node;
            d_ptr = d_ptr -&gt; set_link();
            d_ptr -&gt; data = s_ptr -&gt; get_data();
            s_ptr = s_ptr -&gt; link();
        } //end while

        d_ptr -&gt; set_link() = NULL;     
    } //end else 
}
</code></pre>

<p>Thanks in advance for any help. You guys are awesome.</p>

<p>Edit:
This is the code to set the link:
<code>void set_link(node * n){link = n;}</code></p>

<p>This is the code to get the data:
<code>T get_data(){return data;}</code></p>

<p>Edit 2:
It's not compiling for me. On the lines that declare a <code>new node</code> I am getting the error:
<code>expected type specifier before node</code>
<code>expected ';' before node</code></p>

<p>Am I missing a <code>&lt;T&gt;</code> somewhere?</p>
