[Issue 13586] Destructors not run when argument list evaluation throws
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Oct 27 08:38:59 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13586
--- Comment #17 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to Sobirari Muhomori from comment #16)
> (In reply to monarchdodra from comment #15)
> > I could be talking out of my ass, but I'd *assume* ownership transfer is
> > required for proper move semantics.
>
> AFAIK, move semantics is need only for return values, not for arguments.
Passing ownership into the callee is needed everywhere the callee gets an
rvalue and then e.g. forwards it along. It's a great optimization that
simplifies D code compared to C++ code, which is always burdened with cleaning
up objects at the caller level.
--
More information about the Digitalmars-d-bugs
mailing list