eboyd wrote:so is there an advantage to using iterator to perform such operations?
Ehm... for example in those cases where you want something that looks like a pointer but actually is an object (for which you can overload operators)... i.e., in your very case.
Every good solution is obvious once you've found it.