Removing an element by value rather than position from a square vector
<p>as part of some implementation for a sudoku gameboard, each square is given a set of possible values, and a row and column number. </p>

<p>I did this through a square vector with a set for the possible values, where certain values would be removed from the set of possible values, adhering to the rules of sudoku (eg in the same x and y values, or in the same subsquare)</p>

<p>The problem I'm having is I don't know how to remove a specific value from the set, I had it set up like this: </p>

<pre><code> vector&lt; vector&lt; std::set &lt;int&gt; &gt; &gt; gameboard;
</code></pre>

<p>.. double for loop here to cycle through the grid ...</p>

<pre><code> int removeValue = *gameboard[x][y].begin();


 gameboard[x][y].erase(removeValue); 
</code></pre>

<p>But I'm pretty sure thats just removing the value at whatever position in the vector, which isn't what I want. Any ideas?</p>