How can you force a function to return a rvalue? I thought returning something by value would do that, but apparently this returns a lvalue:
Would this make it into a rvalue?Code:MyClass MyClass::operator++(int) { MyClass old(*this); ++(*this); return old; }
Code:const MyClass MyClass::operator++(int) { MyClass old(*this); ++(*this); return old; }