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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Oct 26 04:35:19 PDT 2014


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

--- Comment #15 from monarchdodra at gmail.com ---
(In reply to Sobirari Muhomori from comment #14)
> (In reply to Walter Bright from comment #11)
> > Because the caller can transfer ownership to the callee. If the callee never
> > destructed its parameters, this could not be done.
> 
> If transfer of ownership makes things messy, it's better to not do that. Is
> there a reason, why the caller can't keep ownership to itself?

I could be talking out of my ass, but I'd *assume* ownership transfer is
required for proper move semantics. The easiest way to move an object from
scope A to scope B would be for A to "give ownership" to B.

EG:

foo(getLValue());

Here the outerscope calls neither postblit nor destructor.

Speaking of which: Walter, is there anything blocking
https://issues.dlang.org/show_bug.cgi?id=12684 ?

Or has it simply not been brought to DMD team's attention?

--


More information about the Digitalmars-d-bugs mailing list