finding an element in a 2d vector and then removing it
<p>Let's say I have my data in a 4 by 3 <code>vector&lt;vector&lt;int&gt; &gt;</code> as:</p>

<pre><code>1   2   3
4   5   6
7   8   9
10  11  12
</code></pre>

<p>and I want to delete every row containing the element <code>8</code> and end up like:</p>

<pre><code>1   2   3
4   5   6
10  11  12
</code></pre>

<p>I have been trying to do:</p>

<pre><code>for (vector&lt;vector&lt;int&gt; &gt;::iterator it = v.begin(); it != v.end(); it++) {
    if (find(it-&gt;begin(), it-&gt;end(), 8)) {
        // I will remove the row in here
    }
}
</code></pre>

<p>which gives me:</p>

<pre><code>error: no matching function for call to 'find(std::vector&lt;int&gt;::iterator, std::vector&lt;int&gt;::iterator, int)'
</code></pre>

<p>I don't have much experience with <code>stl</code> so I was wondering:</p>

<ul>
<li>what's wrong with my <code>find</code> call?</li>
<li>is it safe to remove an element from a vector while iterating over it?</li>
</ul>

<p>Ofc any elegant solution to my problem is also welcomed..</p>
