Poll: do you use @property semantics?

Ogi ogion.art at gmail.com
Wed Sep 14 22:23:00 UTC 2022


On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole 
wrote:
> So, who uses @property semantics?

I would use `@property` a lot if it was actually useful.
```D
struct S {
     int _x;
     @property int x() const {
         return _x;
     }
     @property void x(int value) {
         _x = value;
     }
}
void main() {
     S s;
     // Doesn’t work:
     //s.x += 1;
     // Neither does this:
     //s.x++;
}
```



More information about the Digitalmars-d mailing list