DIP4: Properties

Daniel Keep daniel.keep.lists at gmail.com
Sun Jul 26 09:31:23 PDT 2009


Michiel Helvensteijn wrote:
> Daniel Keep wrote:
> 
>>> I used an example without trivial properties because... well, you just
>>> use member variables for that. That's why I don't see real value in
>>> adding default properties getter/setters.
>> interface I
>> {
>>     int opGet_value();
>> }
>>
>> You cannot use fields in an interface.
> 
> You do understand that properties with automatic backing storage would
> probably also not be allowed in interfaces. They'd have the same memory
> layout problems as fields.

*blink*

You wouldn't declare a property with automatic backing in an interface;
that would be specifying implementation which you're not allowed to do.

I was demonstrating why trivial properties exist in real code.  It's the
*class* that would declare a property with automatic storage.



More information about the Digitalmars-d mailing list