On Monday, December 24, 2012 13:45:10 Andrei Alexandrescu wrote: > The very binding of rvalues to const ref would allow that breakage. We > can't allow that to happen.
But it's only bound for the length of the statement. After that, the binding can no longer exist (as the binding was a function parameter). And as I understand it, temporaries only go out of scope once the statement has completed. So, foo(bar(min(5, 7))); wouldn't be a problem no matter what bar or foo did, because no reference to 5, 7, or the return values of any of the functions could be kept. It's being able to do const int& i = foo(bar(min(5, 7))); which would allow a reference to be kept around, which D disallows. - Jonathan M Davis
