Post-ctor ctor
bearophile
bearophileHUGS at lycos.com
Sun Aug 7 11:34:40 PDT 2011
Andrej Mitrovic:
> Good idea / bad idea?
I prefer a solution that to me looks simpler, discussed a bit here:
http://d.puremagic.com/issues/show_bug.cgi?id=3878
With that idea your struct becomes:
struct Foo {
int a, b, c, d, sum, average;
this(int this.a, int this.b, int this.c, int this.d) {
sum = a + b + c + d;
average = (a + b + c + d) / 4;
}
}
Bye,
bearophile
More information about the Digitalmars-d
mailing list