title: Error: binding to reference of type discards qualifiers
body: <p>I am so sorry, I know this has been asked before, but even if I tried reading all the other answers to similar questions I can't understand my error.
  I am using Eclipse, I am programming in C++ and I am trying to make a <strong>linked list</strong> using templates.</p>
  
  <p>I am using a <strong>node class</strong> that will be useful for my linked list, and I have this function specification:</p>
  
  <pre><code>template &lt;class item&gt;
  void list_insert(node&lt;item&gt;*&amp; head, const item&amp;e);
  </code></pre>
  
  <p>Allright. I want to use this function SO in my <strong>list class</strong> I can have this:</p>
  
  <pre><code>template &lt;class item&gt;
  class list{
  public:
      list(){head=NULL;}
  
      void set_head(node&lt;item&gt;*h){head=h;}
      node&lt;item&gt;*&amp; get_head(){return head;}
      const node&lt;item&gt;* get_head()const{return head;}
  
      bool empty()const{return head==NULL;} // is the list empty?
  
      void insert(const item&amp;e){list_insert(head,e);} //ERROR GETS HERE!
      void print(); // print the list clockwise
      void printback(); //print it counterclockwise
  
  private:
      node&lt;item&gt;* head;
  };
  </code></pre>
  
  <p>I do that so I can implement list_insert like this:</p>
  
  <pre><code>template &lt;class item&gt;
  void list_insert(node&lt;item&gt;*&amp; head, const item&amp; e){
      head= new node&lt;item&gt;(e,head);
  }
  </code></pre>
  
  <p>Now, in this last piece of code I get this error:</p>
  
  <p><strong>error: binding 'const int' to reference of type 'int&amp;' discards qualifiers</strong></p>
  
  <p>I have read that basically the compiler is telling me ''ehi, if you do that, the const condition you wanted will be violated, so I give you an error'', allright, but still I don't understand the actuall error, or, anyway, what is the reasoning behind it. </p>
  
  <p>Also because I am supposed to do a counterclockwise insert function too, but I am having troubles with the clockwise actually, so I am pretty stuck.</p>
  
  <p>Thank you so much in advance.</p>
  
  <p>EDIT: I am so sorry I did not provide actual example of what I am doing.
  Basically, I am trying to make a linked list - simply and basic for my exam. </p>
  
  <p>My linked-list is basically a stack made of nodes. Nodes are the component of my list, that are made of a data part and a link to the next node part:</p>
  
  <pre><code>template &lt;class item&gt;
  class node{
  public:
      //CONSTRUCTOR
      nodo(item &amp; d=item(), nodo*l=NULL){
          data=d;
          link=l;
      }
  
      //GET E SET METHODS
      void set_data(item&amp; d){data=d;}
      void set_link(node*l){link=l;}
  
      item&amp; get_data(){return data;}
      const item&amp; get_data()const{return data;}
      node*&amp; get_link(){return link;}
      const node* get_link()const{return link;}
  
  private:
      item data;
      node* link;
  };
  </code></pre>
  
  <p>Now, as said my list is made of nodes and in the private part I declared a pointer to the head of the list.</p>
  
  <pre><code> node&lt;item&gt;* head;
  </code></pre>
  
  <p>That is the example of this code-- and then the problem occurs as I wrote before. </p>