Andrei Alexandrescu wrote:
Steven Schveighoffer wrote:
1. Choosing between including @property or not is rare. Most cases are obvious. If you worked with a language that requires property notation (i.e. C#) this would not be as big an issue for you.

I need to put it for all front() and empty() declarations. By the way I decided that popFront() is not a property. I don't know why.

Because it's an action, not a property.  Simple as that. :)

Actually, the functions you mention are probably the best examples of why the @property attribute is so cool. Using it, you can signify that empty tests for emptiness, and doesn't empty() the range or container.

Rule of thumb:
  noun or adjective --> property
  verb --> not property

-Lars




-Lars

Reply via email to