Is it better to return a reference or a new instance of the object?
For example :
Which one is better ?Code:class A { private : int seed; A(int s):seed(s){}; A& operator + (const A &a); { seed+=a.seed; return *this; } A operator + (const A &a); { return A(seed+a.seed); }




Reply With Quote