Unexplained 'std::out_of_range' of vector
<p>I am having an unexplained vector out of range error!</p>

<pre><code>for (unsigned int i = 0; i &lt; studentsVector.size(); i++) {

    bool anyFailedFacultyCourse = false;
    bool anyFailedElectiveCourse = false;
    // Check if all faculty courses are done
    std::cout &lt;&lt; currentSemester &lt;&lt; std::endl;
    if (currentSemester &gt; 1) {
        std::cout &lt;&lt; "hi" &lt;&lt; std::endl;

        for (int j = 0; j &lt; currentSemester - 1; j++) {
            if (studentsVector.at(i)-&gt;getPlan().at(j).size() &gt; 0) {

                anyFailedFacultyCourse = true;
            }
        }

        std::cout &lt;&lt; "bye" &lt;&lt; std::endl;
</code></pre>

<p>After debugging, I noticed that the program does get into the first for loop, assigns proper values for <code>AnyFailedFacultyCourse</code> and <code>anyFailedElectiveCourse</code>, prints the int <code>currentSemester</code>. And there it stops!
I put a debug breakpoint at:</p>

<pre><code>if (currentSemester &gt; 1)
</code></pre>

<p>and it just gives me an <code>out_of_range error</code> before it even checks! Meaning it does not even get into <code>if (currentSemester &gt; 1)</code> 
But there is nothing in between! I mean, how could it throw anything like that when, where it throws the error, I did NOTHING to any vector!</p>

<p>I know this is kind of mysterious, ask for any further information you need.</p>

<p>Further info:
How students vector is declared:</p>

<pre><code>std::vector&lt;Student*&gt; studentsVector;
currentSemester:

int currentSemester = 1;
</code></pre>
