title: Vector Erase Error
body: <p>I have the following code in C++:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;ctime&gt;
  #include &lt;vector&gt;
  int main ()
  {
      srand(time(0));
      int noOfElements = 9;
      for (int a = 0; a &lt; 9; a++)
      {
          std::vector&lt;int&gt; poss;
          for (int a = 1; a &lt;= 9; a++)
              poss.push_back(a);
          for (int b = 0; b &lt; 9; b++)
          {
              int random = rand() % 9;
              std::cout &lt;&lt; poss[random];
              poss.erase(random);
              noOfElements--;
          }
          std::cout &lt;&lt; "\n";
      }
  }
  </code></pre>
  
  <p>Yet when I run it, it returns this:</p>
  
  <pre><code>error: no matching function for call to 'std::vector&lt;int&gt;::erase(int&amp;)'
  </code></pre>
  
  <p>for line 13.</p>
  
  <p>Why is this and how can I correct it?</p>