I could not think of what to call this because I don't know if it has a name to call it by.

Basicly what I was wondering is if their was a way in D to make a class function pass the object being called on by reference.

might be easier to show code, basically I want something like this to be possible

class A
{
//some how signify that this function passes 'this' by reference
     public void replace()
     {
          this = new A();
     }
}

...

A a = new A();
A b = a;
b.replace();
assert(b != a);

I don't know if I am being clear or if their is something better to call this.

Thanks for the help
Tofu

Reply via email to