rvalue references

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Apr 23 13:44:02 PDT 2013


On 4/23/13 4:24 PM, Timon Gehr wrote:
> On 04/23/2013 07:15 PM, Andrei Alexandrescu wrote:
>> ...
>>
>> The justification is that unsafe uses of ref are few and uninteresting
>> (they can be replaced with pointers).
>
> I don't get this. Uses cannot be "unsafe". They are either correct or
> wrong.

Unfortunately the safe/unsafe and correct/wrong sets don't overlap 
perfectly.

>> It would be very powerful to be
>> able to guarantee that safe code can use ref.
>> ...
>
> It is not required to make ref guaranteed safe in @system code to
> guarantee this.

Yah, agreed. It would be nice to have ref offer guarantees to all code 
while also being powerful, but if we can't make that @safe is always a 
possibility.


Andrei


More information about the Digitalmars-d mailing list