Issue 1974 - What's your opinion?
Dukc
ajieskola at gmail.com
Sat Oct 26 14:22:04 UTC 2019
On Friday, 25 October 2019 at 11:44:46 UTC, Timon Gehr wrote:
> On 24.10.19 13:45, Dukc wrote:
>> On Thursday, 24 October 2019 at 08:02:28 UTC, RazvanN wrote:
>>> Hello everyone,
>>>
>>> [snip]
>>
>> The root cause here, I think, is that `Foo.opAddAssign` takes
>> the implicit member parameter as `auto ref`
>
> That's not what `auto ref` means! The `this` parameter is a
> `ref` parameter within the body of the called member function,
> so it is not `auto ref`.
Yeah, I wasn't precise. I meant that optimally, `Foo.opAddAssign`
should not accept a rvalue member argument, just like `ref`
parameters normally don't accept rvalue arguments.
As Manu has often said, it's oftentimes problematic when `ref`
parameters don't accept rvalues. Here we have the opposite
problem.
More information about the Digitalmars-d
mailing list