title: Subscript of vector is sometimes out of range
body: <p>I have a genetic algorithm program, everything is allocated dynamically using vectors. Nowhere is the number of generations or individuals per generation set at compile time.</p>
  
  <p>I tried it using 500, 1000, 2000 generations, it runs perfect. Then I tried 10,000 generations. It gave me debug assertion failed, vector subscript out of range at generation 4966.</p>
  
  <p>I tried again twice with the same parameters, 10,000 generations, it ran fine.</p>
  
  <p>I tried it once more, I got the error at generation 7565.</p>
  
  <p>It's strange that sometimes it works perfectly, sometimes I get the error. Especially considering that everything is done using vectors.</p>
  
  <p>Any ideas on where could the problem come from? Maybe the debug mode is buggy for some reason?</p>