I think the call to erase() makes the iterator point to a different item, so this would require juggling the item pointer in a temporary variable. Also, I think these methods aren't thread-safe, anyway.