title: LinkedList using initializer_list
body: <p>So, i'm trying to initialize a LinkedList class using an initializer_list.</p>
  
  <pre><code>template&lt;typename T&gt;
  SortedList&lt;T&gt;::SortedList(initializer_list&lt;T&gt; e){
      head_= new Node&lt;T&gt;(*e.begin());
  
      long intcheck = 0;
      T old;
  
      for (auto x : e){
          if(intcheck &gt; 0){
              Node&lt;T&gt;* curr = new Node&lt;T&gt;(old);
              if(head_ == curr){
                  head_-&gt;next_ = new Node&lt;T&gt;(x);
              }
              curr-&gt;next_ = new Node&lt;T&gt;(x);
          }
  
          old = x;
          intcheck = 1;
      }
  
  
  }
  </code></pre>
  
  <p>I get a seg fault when trying to print head_->next_  (nothing wrong with my print function)</p>