Redundancies often reveal bugs

bearophile bearophileHUGS at lycos.com
Fri Oct 1 20:07:47 PDT 2010


> // Code #2
> struct Something {
>     int x, y, aa;
>     this(this.x, this.y, int a_) {
>         this.aa = a_ * a_ + x;
>     }
>     void update(this.x) {
>         this.aa += b;
>     }
> }

Sorry, that's wrong. The correct part:

    void update(this.x, int b) {
        this.aa += b;
    }

Bye,
bearophile


More information about the Digitalmars-d mailing list