class invariants and property declarations

Jesse Phillips jessekphillips+D at gmail.com
Wed Feb 16 09:47:32 PST 2011


Dmitry Olshansky Wrote:

> Now to properties, this is actually shouldn't be allowed:
> 
>   @property int hours;
> 
> @property is a annotation applied to functions (getter/setter), to allow calling it with omitted () and a natural assign syntax like this:

Why shouldn't it be allowed? While it provides no benefit it does document that it is a property.



More information about the Digitalmars-d-learn mailing list