title: c++ map/set iterator not dereferencable
body: <p>I want to ask you for a hint, as I am a beginner and couldn't find any suitable answer in the internet.
  I am getting this error: 
  <strong>debug assertion failed - map/set iterator not dereferencable</strong>
  at the line that looks like this:</p>
  
  <pre><code>pointA = active-&gt;pointNext(timeNext);
  </code></pre>
  
  <p>with the function <strong>pointNext()</strong> as I see everything is ok, and what concerns <strong>active</strong>, I have:</p>
  
  <pre><code>active = setS.data.end();
  </code></pre>
  
  <p>Some more info:</p>
  
  <p><strong>active</strong> is <strong>multiset&lt; classA, classB::classC >::const_iterator</strong></p>
  
  <p><strong>setS</strong> has: <strong>setS.Q, setS.W, setS.T</strong> and <strong>setS.data</strong>, 
  whereby <strong>setS.data</strong> has inside 0 in square braces.
  When I have multiset iterator declaration in .cpp file, during debug I cannot enter to see what is inside active, when it is in .h file, I can.</p>
  
  <p>Having in .cpp I cannot enter <strong>active</strong>, so can imagine it's like pointer(iterator) cannot dereference, because is wrong inside. What if it is empty, i.e. if <strong>setS.data</strong> is empty? or if there's some trash inside?</p>
  
  <p>I know the thing was running under linux previously, is there some feature which I have to change for running on windows maybe? For example to change a number of template parameters to one only? (to properly ascribe <strong>setS.data</strong> to <strong>active</strong>, because I am not sure - do I do it properly?</p>
  
  <p>Sorry for this rather chaotic post, I wanted to add my guesses for someone to neglect them if they are wrong. If something here is unclear or lack of some information, I will gladly add it. 
  Can you please tell me what reasons could cause the dereferencablility error I get and where should I look for it? Because I am stuck and don't know how to proceed.</p>
  
  <p>any help very appreciated, thanks!</p>