Suppose I have the following:
class foo
{
public:
foo& Ref() { return *this; }
int stuff;
};
void do_stuff(foo& f)
{
f.stuff = 1;
}
int main()
{
do_stuff(foo().Ref());
}
I'm modifying an rvalue via lvalue reference. Is this legal? If so or if not, can someone explain why and provide relevant section in the standard?