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

kinke noone at nowhere.com
Fri Jan 25 10:57:35 UTC 2019

On Thursday, 24 January 2019 at 23:59:30 UTC, Walter Bright wrote:
> On 1/24/2019 1:03 PM, kinke wrote:
>> (bool __gate = false;) , ((A __pfx = a();)) , ((B __pfy = 
>> b();)) , __gate = true , f(__pfx, __pfy);
> There must be an individual gate for each of __pfx and pfy. 
> With the rewrite above, if b() throws then _pfx won't be 
> destructed.

There is no individual gate, there's just one to rule the 
caller-destruction of all temporaries. That's the current state, 
and there's no need for that to change. I was trying to say that 
a rewrite as expression, as requested as part of the assessment, 
clearly isn't enough, as the dtor expressions aren't visible this 
way, and neither is the scoping (when the dtor expression of 
`__pfx` comes into play etc.).

More information about the Digitalmars-d-announce mailing list