title: C++ problems with conversion
body: <p>I have one semestral work (own double linked list) and our teacher want this definition of class DoubleList:</p>
  
  <pre><code>template &lt;typename T&gt;   //just part of all methods
  class DoubleList { 
  public: 
  
      DoubleList(void);   //We HAVE TO follow this definitions 
  
      void AddFirst(const T &amp;);     //const!
      T &amp;AccessActual(void); 
      T RemoveFirst(void);
  }
  </code></pre>
  
  <p>My question is, how can I define a node? <code>AddFirst</code> have const argument and other methods haven't. Data must be set in constructor and then they can't be changed. Is this task so limited or are here other ways to complete the task?</p>
  
  <p>Here is my actual <code>Node</code>:</p>
  
  <pre><code>template &lt;class U&gt;
          class Node{
              Node&lt;U&gt; * next;
              Node&lt;U&gt; * previous;
              const U * data;
          public:
              Node(const U *data){   //
                  next = NULL;
                  previous = NULL;
                  this-&gt;data = data;
              }
              void SetNext(Node&lt;U&gt; *next) { 
                  this-&gt;next = next; 
              }
              Node&lt;U&gt; *GetNext(){ return next; }
              void SetPrevious(Node&lt;U&gt; *previous) { 
                  this-&gt;previous = previous; 
              }
              Node&lt;U&gt; *GetPrevious(){ return previous; }
              const U *GetData() { return data; }
          };
  </code></pre>