DIP 36: Rvalue References

Jonas Drewsen nospam4321 at hotmail.com
Thu Apr 11 02:46:23 PDT 2013


Isn's it too strict? The following example would not work because 
you cannot take the address of the parameter. But it would still 
be nice to have it passed by ref and scoped:

struct Item
{
    int data;
    Item* next;
}

void printThem(const scope ref Item first)
{
     auto it = &first;
     while (it)
     {
         std.stdio.writeln(*it);
         it = it.next;
     }
}


/Jonas


More information about the Digitalmars-d mailing list