On Sun, 02 Jan 2011 05:29:48 -0500, spir <[email protected]> wrote:

Hello,

Using properties allows travesting a method call into direct data access. What if the underlying member actually is plain data? Would it be possible to provide a real data member where the language expects a property (for instance as range empty & front properties)?

Yes, just use a data member:

struct MyRange {
   int front;
   bool empty;
   void popFront();
}

A property is actually supposed to work just like a field.

There is no need for new syntax.

-Steve

Reply via email to