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`

  • DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
    • Re: DIP1000 ag0aep6g via Digitalmars-d-learn
      • Re: DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
        • Re: DIP1000 ag0aep6g via Digitalmars-d-learn
          • Re: DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
          • Re: DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
            • Re: DIP... Paul Backus via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Dukc via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn
    • Re: DIP1000 Loara via Digitalmars-d-learn

Reply via email to