<p>Currently I'm trying to erase a sequence of iterators from a set, however GCC's standard library seems to be broken because std::set::erase(iterator) should return the an iterator (next iterator), however in GCC it returns void (which is standard?)</p>

<p>Anyways I want to write:</p>

<pre><code>myIter = mySet.erase(myIter);
</code></pre>

<p>But GCC doesn't like it...
So Is it safe to write this instead?</p>

<pre><code>mySet.erase(myIter++);
</code></pre>

<p>Edit: And yes I'm checking against mySet.end();</p>

There is no problem with
```
```
mySet.erase(myIter++);
```
```
The order of operation is well-defined: myIter is copied into myTempIter, myIter is incremented, and myTempIter is then given to the erase method.
For Greg and Mark
: no, there is no way operator++ can perform operations after the call to erase. By definition, erase() is called after operator++ has returned.