-preview=in might break code

Walter Bright newshound2 at digitalmars.com
Mon Oct 5 09:53:37 UTC 2020


On 10/5/2020 1:34 AM, Iain Buclaw wrote:
> Furthermore, NRVO is implementation defined, which results in the same 
> dmd/gdc/ldc making different decisions for "to ref or not to ref", and yet I see 
> no one complaining about that.

I don't see that as a to ref or not decision. It is an issue of how many copies 
are made, there shouldn't be dangling references to those copies, or it 
shouldn't NRVO it.

I don't recall any case of NRVO breaking code since I invented it 30 years ago, 
other than something that relied on the number of copies.


More information about the Digitalmars-d mailing list