DIP 1016--ref T accepts r-values--Formal Assessment

Manu turkeyman at gmail.com
Sat Jan 26 03:36:09 UTC 2019

On Fri, Jan 25, 2019 at 6:50 PM Neia Neutuladh via
Digitalmars-d-announce <digitalmars-d-announce at puremagic.com> wrote:
> On Fri, 25 Jan 2019 18:14:56 -0800, Manu wrote:
> > Removing the `void` stuff end expanding such that the declaration +
> > initialisation is at the appropriate moments; any function can throw
> > normally, and the unwind works naturally?
> The contention was that, if the arguments are constructed properly,
> ownership is given to the called function, which is responsible for
> calling destructors.

No, that was never the intent, and certainly not written anywhere.
Ownership is assigned the the calling scope that we introduce
surrounding the statement. That's where the temporaries declared; I
didn't consider that ownership unclear.

> I'm not sure what the point of that was. The called function doesn't own
> its parameters and shouldn't ever call destructors. So now I'm confused.

Correct. You're not confused. The callee does NOT own ref parameters.

More information about the Digitalmars-d-announce mailing list