It is confusing to have a boolean argument with a value that does not matter -- iterator(true) means the same thing as iterator(false) and neither one means the same as iterator().

If we expect that the caller will always know exactly which behavior they want, it would be better to use a different function name with no argument like iteratorDeletingAsWeGo(). If we think that future callers might want to decide at runtime whether to delete as they go, then the argument makes sense, and "iterator(false)" should have the same meaning as "iterator()". If we think that future callers might want to decide at compile time, it should be a template function.