I was wondering, why the following way of code (Already commented out) will cause C2102: \'&\' requires l-value
C2102: \'&\' requires l-value
Is there a better way to avoid u
The & operator must be applied to an lvalue. When the call aa.get_dummy() is not assigned to a variable, its return value is only put on the stack, so it would be silly (and erroneous) to get the address of a stack item.
&
aa.get_dummy()