On Wed, 16 Feb 2011 12:47:32 -0500, Jesse Phillips <jessekphillip...@gmail.com> wrote:

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.


Regardless of this, you should be aware that an invariant is not called when a public field is changed/accessed, whether it's marked with @property or not. Only member functions invoke the invariant.

-Steve

Reply via email to