@property - take it behind the woodshed and shoot it?

deadalnix deadalnix at gmail.com
Thu Jan 24 21:01:52 PST 2013


On Friday, 25 January 2013 at 00:55:54 UTC, kenji hara wrote:
> I can imagine a situation that we might not want to treat 
> property
> functions as DATAs simply.
>
> If you have a struct which have some property functions as 
> members, and
> you'd want to serialize it:
>
> struct S {
>    int value_;
>    @property int value() { return value_; }
> }
>
> At least, the serialization library should recognize the 
> S.value is a
> _property function_, not a int DATA.
>
> In most case, property functions should be treated as a simple 
> DATA field.
> but in a few case, it shouldn't. I have thought 
> AddressExpression &func is
> one of the places.
>
> Related bugzilla issue I posted:
> http://d.puremagic.com/issues/show_bug.cgi?id=9062
>

Indeed ! @property should be different as far as reflection is 
involved. For usage, it shouldn't make any difference.


More information about the Digitalmars-d mailing list