title: List iterator not incrementable? - Run-Time Error
body: <p>I was trying to fit list creation in a class, but ran into this run-time error called:</p>
  
  <blockquote>
    <p>Debug Assertion Failed! Expression: list iterator not incrementable</p>
  </blockquote>
  
  <p>I can't figure out what the problem is. Here's the code:</p>
  
  <pre><code>// Core.cpp //
  
  #include "Core.h"
  
  class List {
  private:
      int Size;
      int Values;
      list&lt;int&gt; Data;
      list&lt;int&gt;::iterator IT;
  public:
      List(int S, int V) {Size = S; Values = V;}
      void MakeList();
      void TargetElement(int Element);
      void ChangeElement(int Value);
      void DisplayList();
  };
  
  void List::MakeList() {
      list&lt;int&gt; Data(Size, Values);
      list&lt;int&gt;::iterator IT = Data.begin();
  }
  
  void List::TargetElement(int Element) {
      advance(IT, Element);
  }
  
  void List::ChangeElement(int Value) {
      list&lt;int&gt;::iterator INSERT = Data.begin();
      Data.insert(INSERT, Value);
  }
  
  void List::DisplayList() {
      list&lt;int&gt;::iterator OUTPUT;
      for(OUTPUT = Data.begin(); OUTPUT != Data.end(); OUTPUT++) {
          //cout &lt;&lt; *OUTPUT &lt;&lt; endl;
      }
  }
  
  int main() {
  
      List Container(10, 0);
      Container.MakeList();
      Container.TargetElement(3);
      Container.ChangeElement(20);
      Container.DisplayList();
  
      cin.get();
      return 0;
  }
  </code></pre>
  
  <p>Any suggestions on how I could fix this issue?</p>
  
  <p>EDIT: I looked everywhere for an answer and I still can't seem to find the solution. Debugging and finding the break-point didn't help either.</p>