DIP1000

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Jun 23 16:08:01 UTC 2022


How am I supposed to write this:

```d
import std;
@safe:

struct node {
     node* next;
}

auto connect(scope node* a, scope node* b)
{
     a.next = b;
}

void main()
{
     node x;
     node y;
     connect(&x,&y);
}

```

> Error: scope variable `b` assigned to non-scope `(*a).next`



More information about the Digitalmars-d-learn mailing list