On Tuesday, 1 January 2013 at 08:49:29 UTC, Era Scarecrow wrote:
On Monday, 24 December 2012 at 19:09:35 UTC, Jonathan M Davis
wrote:
On Monday, December 24, 2012 20:03:24 monarch_dodra wrote:
Snap. You got me.
It wouldn't matter if the function accepted its argument by
value. You'd still be returning a reference to a variable that
doesn't exist anymore.
So what if it does exist? Say the temporary lives as long as
the current scope lives?
Make that the scope of the variable it's being assigned to...