This is a good suggestion, but notice that the iterator also provides getKey() and getValue() methods, which do not copy. So, if you have a situation where performance may suffer due to the copying done by oprator*, you can use getKey() and getValue() in the mean time.
This is a good suggestion, but notice that the iterator also provides getKey() and getValue() methods, which do not copy. So, if you have a situation where performance may suffer due to the copying done by oprator*, you can use getKey() and getValue() in the mean time.