DIP23 Counter Proposal

Robert jfanatiker at gmx.at
Thu Feb 7 13:05:39 PST 2013


> > struct S
> > {
> >  @property int i;
> > }
> >

You missed the point. When this gets lowered to accessor functions and a
private variable, you ensure that you can later on add your magic soup,
without breaking code that relied on i being a real field. (E.g. taking
the address, using +=, -=, ...)

Although += or -= can still be added for properties, but the important
thing is, that for an @property declared field nothing is possible, that
is not also possible with a property created by manually writing set/get
methods.



More information about the Digitalmars-d mailing list