Compiler Error C2609

'conversion' : cannot implicitly convert a non-lvalue 'type1' function return to a 'type2' that is not const

A reference cannot be initialized from a non-lvalue function return.

This is an error when the ANSI compatibility option is enabled (/Za) and a warning when the Microsoft extensions are enabled (/Ze).

The following is an example of this error:

struct X 
{
    X( int );
};
X f();
X& r = f();   // error