Rusty/Beginner C++ compiler error
<p>I'm a relatively experienced programmer, coming back into some C++ review for a class.  We have an assignment to write a couple relatively simple c++ programs.  Getting an odd error that I'm not used to, but I'm sure it's child's play for this community.</p>

<pre><code>int pull_next_element (int r, std::vector&lt;int&gt;&amp; sequence) {
    int x = sequence[0];
    sequence.erase(sequence.begin());  //orig: sequence.erase(0);
    return x;
}
</code></pre>

<p>Error I was getting:</p>

<pre><code>Error C2664: 'std::_Vector_iterator&lt;_Myvec&gt; std::vector&lt;_Ty&gt;::erase(std::_Vector_const_iterator&lt;_Myvec&gt;)' : cannot convert parameter 1 from 'int' to 'std::_Vector_const_iterator&lt;_Myvec&gt;'
</code></pre>

<p>EDIT: Replaced with iterator instead of numerical index, and otherwise fixed this problem throughout the code.  Thanks everyone.</p>
