Rvalue references - The resolution

Walter Bright newshound2 at digitalmars.com
Sat May 4 16:44:34 PDT 2013


On 5/4/2013 4:34 PM, Walter Bright wrote:
>> And later down the road, maybe even in 2.064, ref will take r-values
>> making the new code error because of ambiguity between the two
>> functions.
>>
>> Has code breakage ever been taken into account during this dconf conversation?

I see what you mean now. You mean how does an rvalue overload if faced with T 
and ref T. Currently:

   void foo(ref int i);
   void foo(int i);

   void main() {
     int i;
     foo(i);    // matches ref int
     foo(1);    // matches int
   }

I don't think that should change with this proposal.


More information about the Digitalmars-d mailing list