digitalmars.D.learn - struct =?UTF-8?B?c3Rhwq10aWMgaW5pwq10aWFswq0=?= =?UTF-8?B?aXplcg==?=
- learnfirst1 (19/19) Dec 06 2018 my question is how to easy use struct static initializer
- Basile B. (2/21) Dec 06 2018 Looks like what you want is named parameters.
- Radu (4/30) Dec 06 2018 Actually he's looking for in-place struct initialization
- learnfirst1 (2/4) Dec 06 2018 this is what I need, I guess I has to wait.
my question is how to easy use struct static initializer method with UDA. Fake code: struct DbColumn { string name; bool unique ; bool signed ; bool nullable ; } struct Order { uint id; DbColumn({ .nullable= true}) // not working string order_id; DbColumn({ :nullable= true}) // not working string order_time; DbColumn(nullable= true) // not working string order_time; }
Dec 06 2018
On Thursday, 6 December 2018 at 11:04:23 UTC, learnfirst1 wrote:my question is how to easy use struct static initializer method with UDA. Fake code: struct DbColumn { string name; bool unique ; bool signed ; bool nullable ; } struct Order { uint id; DbColumn({ .nullable= true}) // not working string order_id; DbColumn({ :nullable= true}) // not working string order_time; DbColumn(nullable= true) // not working string order_time; }Looks like what you want is named parameters.
Dec 06 2018
On Thursday, 6 December 2018 at 11:09:47 UTC, Basile B. wrote:On Thursday, 6 December 2018 at 11:04:23 UTC, learnfirst1 wrote:Actually he's looking for in-place struct initialization https://github.com/dlang/DIPs/blob/b1283b455b635d7dcbc2c871d2aa47cc67190059/DIPs/DIP1xxx-sw.md Which would be a real nice feature to have.my question is how to easy use struct static initializer method with UDA. Fake code: struct DbColumn { string name; bool unique ; bool signed ; bool nullable ; } struct Order { uint id; DbColumn({ .nullable= true}) // not working string order_id; DbColumn({ :nullable= true}) // not working string order_time; DbColumn(nullable= true) // not working string order_time; }Looks like what you want is named parameters.
Dec 06 2018
On Thursday, 6 December 2018 at 12:50:34 UTC, Radu wrote:On Thursday, 6 December 2018 at 11:09:47 UTC, Basile B. wrote: Which would be a real nice feature to have.this is what I need, I guess I has to wait.
Dec 06 2018