Give this class:

```d
class A
{
        int X() { return x; }
        int X(int v) { return x = v;}

        private int x;
}
```

I'd like to allow use ```+=```, ```-=``` operators on ```X()``` and keep encapsulation. What's a somehow elegant way to do that?

Reply via email to