Let's say I have this code:
```d
import std.stdio;

class X {

    int x(int param) {
        static int myvar = 1234;

        if (param == 0) return myvar;
        else { myvar = param; return myvar; }
    }

}

void main()
{
    X x1 = new X;
    X x2 = new X;

    x1.x(0).writeln;
    x2.x(0).writeln;

    x1.x(17).writeln;
    x2.x(0).writeln;
}
```

Is there a way to make myvar local to each instance of `X` without making it a variable of `X`? Just curious.

Reply via email to