[Issue 13586] Destructors not run when argument list evaluation throws

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Oct 27 01:01:50 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13586

--- Comment #16 from Sobirari Muhomori <dfj1esp02 at sneakemail.com> ---
(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.

> foo(getLValue());
> 
> Here the outerscope calls neither postblit nor destructor.

A proposed solution to this issue is to place arguments on the caller's stack,
so that's where they're moved, not to the callee's stack.

--


More information about the Digitalmars-d-bugs mailing list