Post-ctor ctor

bearophile bearophileHUGS at lycos.com
Sun Aug 7 11:35:49 PDT 2011


> With that idea your struct becomes:

Or just:

struct Foo {
    int a, b, c, d, sum, average;

    this(this.a, this.b, this.c, this.d) {
        sum = a + b + c + d;
        average = (a + b + c + d) / 4;
    }
}

Bye,
bearophile


More information about the Digitalmars-d mailing list