rvalue references

Zach the Mystic reachzach at gggggmail.com
Tue Apr 23 23:38:41 PDT 2013


On Wednesday, 24 April 2013 at 03:41:17 UTC, Manu wrote:
> scope ref a(scope ref int x) { return x; }

One thing to bear in mind about this usage is that 'scope' could 
apply to the implicit 'this' reference, in addition to describing 
the return type, which might make it unfeasible. I don't know how 
often you'd want to tag the 'this' with 'scope' but not the 
return, and the other way around.

struct S {
   scope ref a(scope ref int x) { return x; }
}


More information about the Digitalmars-d mailing list