rvalues -> ref (yup... again!)

Manu turkeyman at gmail.com
Fri Mar 30 18:22:52 UTC 2018


On 30 March 2018 at 02:47, Kagamin via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> The only criticism against rvalue references I saw was when the
> reference outlives the temporary.

That's the only *technical* criticism I've ever heard too.
Fortunately, D now has mechanisms for preventing that; D's @safety
story with respect to reference lifetime seems to be solid now.
'return ref', and enforcing ref pointers don't escape the callee
cleared to the road to allow accepting temporaries safety.


More information about the Digitalmars-d mailing list