Re: assign to property 2 values

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 9 July 2021 at 11:04:23 UTC, Dennis wrote: On Friday, 9 July 2021 at 10:19:59 UTC, Виталий Фадеев wrote: It possible in current version 2.097 ? If you `import std.typecons` you can do: ```D element.border = tuple(1, solid).expand; ``` But it's not pretty. I suggest either calling

Re: assign to property 2 values

2021-07-09 Thread Dennis via Digitalmars-d-learn
On Friday, 9 July 2021 at 10:19:59 UTC, Виталий Фадеев wrote: It possible in current version 2.097 ? If you `import std.typecons` you can do: ```D element.border = tuple(1, solid).expand; ``` But it's not pretty. I suggest either calling the function regularly, or combing all settings in a

Re: assign to property 2 values

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 9 July 2021 at 10:19:59 UTC, Виталий Фадеев wrote: I want this feature in D: ``` element.border = 1, solid; struct Element { @property void border( int width, BorderStyle style ) { this.borderWidth = width; this.borderStyle = style; } } ``` Description: ```

assign to property 2 values

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
I want this feature in D: ``` element.border = 1, solid; struct Element { @property void border( int width, BorderStyle style ) { this.borderWidth = width; this.borderStyle = style; } } ``` Description: ``` element.border = 1, solid; ``` will rewriten to the ```