DIP 36: Rvalue References

Zach the Mystic reachzach at gggggmail.com
Sun Apr 21 09:08:54 PDT 2013


On Sunday, 21 April 2013 at 10:55:37 UTC, Dicebot wrote:
>> The DIP for instance, consider that const scope ref is 
>> semantically equivalent to pass by value, when it isn't (and 
>> not only for performance reasons, but for aliasing reasons). 
>> Nothing is considered about it.
>
> At least some objections that make sense and I'd love to see in 
> the very first announcement. If you see any issues that prevent 
> treating "const scope int" as "const scope ref int", please 
> tell about them and they will be addressed in DIP. Because it 
> is the intention. I don't understand what aliasing are you 
> speaking about.

The only thing I could think of was if you want to 'ref' a 
reference type.

void func(ref Object o, scope Object o2, scope ref Object o3) {}

Would there be a difference between the type of o and o2, or of 
o2 and o3? There is inconsistency, but it would be nice to find 
use cases which make this inconsistency truly unworkable with 
other things in the language.


More information about the Digitalmars-d mailing list