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
Because a::get_dummy() returns a unnamed temporary object (int pointer). Object returned by function sit ontop of the stack frame and it is meaningless to get its address since it might be invalid after expression ends.
a::get_dummy()