The only reason I know for returning the reference is when overloading operator[] so that it can be changed by the calling function. I suppose if the object being returned is large enough one could return a reference (or pointer) instead of a copy just to save processing time. In your example, the first version is the best.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343