title: Can't figure out if I'm inputting arguments incorrectly or if there's something wrong with my code
body: <p>So, I barely started learning about linked lists, and I made a a function that inserts a head into the linked list. The problem I'm having trouble figuring out is if I'm entering in the arguments incorrectly, or if my code has some errors.  </p>
  
  <p>node struct:</p>
  
  <pre><code>template&lt;typename T&gt;
  struct node
  {
  public:
      node(node* next = nullptr, const T&amp; item = T());
  
      template&lt;typename U&gt;
      friend ostream&amp; operator &lt;&lt;(ostream&amp; outs, const node&lt;U&gt; &amp;print_me);
  
      T _item;    //crate
      node* next; //label
  };
  </code></pre>
  
  <p>insert_head function:</p>
  
  <pre><code>node&lt;T&gt;* insert_head(node&lt;T&gt; *&amp;head, const T&amp; insert_this)
  {
      //create new dynamic variable
      node&lt;T&gt;* temp = new node&lt;T&gt;;    //IT SHOWS THAT THE ERROR OCCURS HERE
  
      //temp takes in the insert_this item
      temp-&gt;_item = insert_this;
      //temp points to the head so it doesn't lose the location
      temp-&gt;next = head;
      //head points back to temp
      head = temp;
  
      return head;    //returns back the head of the list
  }
  </code></pre>
  
  <p>Main:</p>
  
  <pre><code>{
      node&lt;int&gt;* head_ptr = nullptr;
  
      for(node&lt;int&gt;* nPtr = head_ptr; nPtr != nullptr; nPtr = nPtr-&gt;next)
      {
          insert_head(head_ptr, 7); //insert integer 5 into the head
          PrintList(head_ptr);  //print the linked list
      }
  
  return 0;
  }
  </code></pre>
  
  <p>Error: undefined reference to 'node::node(node*, int const&amp;)'</p>