Code style for property
Stefan via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Mar 12 10:50:41 PDT 2017
On Sunday, 12 March 2017 at 10:47:35 UTC, Andrey wrote:
> Hello, how better to declare properties, for example I have
> class:
>> class Foo {
>> this(in int x, in int y, Bar bar) {
>> this.x = x;
>> this.y = y;
>> this.bar = bar;
>> }
>> private:
>> int x;
>> int y;
>> Bar bar;
>> }
Andrey, you could try https://github.com/funkwerk/accessors
We use it to avoid clutter.
Stefan
More information about the Digitalmars-d-learn
mailing list