Isn't the const modifier here unnecessary? [duplicate]
问题 This question already has an answer here : How can a returned object be assignable? (1 answer) Closed 6 years ago . The " Effective C++ " Item 3 says "Use const whenever possible", and it gives an example like: const Rational operator*(const Rational& lhs, const Rational& rhs); to prevent clients from being able to commit atrocities like this: Rational a, b, c; ... (a * b) = c; // invoke operator= on the result of a*b! But isn't the non-reference return value of functions allready a rvalue ?