Jan 22, 2009

If it is a member function which create a temp variable such as assignment operator, just return by value, not return by reference because it is a loc

If it is a member function which create a temp variable such as assignment operator, just return by value, not return by reference because it is a local object or dynamic allocated object…
If it is a copy constructor, no return value at all
If it is a assignment operator, return value is a reference to *this

No comments:

Post a Comment