-preview=in might break code
Iain Buclaw
ibuclaw at gdcproject.org
Mon Oct 5 11:23:33 UTC 2020
On Monday, 5 October 2020 at 08:42:21 UTC, Mathias LANG wrote:
> On Monday, 5 October 2020 at 08:34:37 UTC, Iain Buclaw wrote:
>> On Monday, 5 October 2020 at 07:55:57 UTC, Walter Bright wrote:
>>> On 10/4/2020 7:19 AM, Iain Buclaw wrote:
>>>> [...]
>>>
>>> The problem is not dmd compiled code calling gdc/ldc compiled
>>> code. The problem is code that works with one compiler fails
>>> with another, because the "to ref or not to ref" decision is
>>> *implementation defined*.
>>
>> 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 cannot resist the bait:
> https://issues.dlang.org/show_bug.cgi?id=20752
Yeah, but isReturnOnStack and NRVO are two different things.
NRVO avoids a copy before passing. :-)
More information about the Digitalmars-d
mailing list