pbuk
Science Advisor
Homework Helper
Gold Member
- 4,970
- 3,219
There IS a purpose to returning the LHS as a reference in assignment operator overloads (like +=), but not simple binary operators like +.Vanadium 50 said:What is the purpose of the & after Length? Why do you want it?
How do I know this? Because I looked it up. I have been programming (not in C++ obviously) for over 40 years without the benefit of this knowledge, and I do not expect ever to need it again.
Why someone would spend time learning about operator overloading (or teaching it for that matter) in a first introduction to C++ is beyond me.
