Quote Originally Posted by Paul McKenzie
That is what remove_if() is for. Usage of the remove_if() algorithm makes writing loops as you've written a moot point.
A little off topic here, but do you recommend simply writing the RemoveMe function as in your example, or would you also recommend using std::mem_fun_ref(&Widget::NeedsToBeRemoved) instead?