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

Steven Schveighoffer schveiguy at gmail.com
Tue Jan 29 03:57:35 UTC 2019

On 1/28/19 9:15 PM, Andrei Alexandrescu wrote:
> On 1/28/19 5:23 PM, Steven Schveighoffer wrote:
>> I already see this kind of bug all the time with alias this.
> Can you please post more detail? It may be of relevance to future work.

Any time you have the alias this, then you can get confused when calling 
a function expecting it to be sent as the original type, but the alias 
this is used instead. In cases where both are seemingly accepted by 
overloads, then it can be confusing which overload is used. Sometimes 
it's as simple as the overload that you were expecting to be called 
won't compile or is deselected by constraints. But the code still 
compiles and runs, just does something different from what you expected.

I meant that the effect is similar to what you were noting.


More information about the Digitalmars-d-announce mailing list