Re: Convert struct to set of fields and pass it's to constructor

2017-02-01 Thread Suliman via Digitalmars-d-learn
On Wednesday, 1 February 2017 at 13:51:28 UTC, Minty Fresh wrote: On Wednesday, 1 February 2017 at 13:37:27 UTC, Suliman wrote: Class constructor accept only set if fields like this(string login, string pass) Can I create structure, fill it, and than pass to constructor? Like this: ``` import

Re: Convert struct to set of fields and pass it's to constructor

2017-02-01 Thread Minty Fresh via Digitalmars-d-learn
On Wednesday, 1 February 2017 at 13:37:27 UTC, Suliman wrote: Class constructor accept only set if fields like this(string login, string pass) Can I create structure, fill it, and than pass to constructor? Like this: ``` import std.stdio; struct ConnectSettings { string login;

Convert struct to set of fields and pass it's to constructor

2017-02-01 Thread Suliman via Digitalmars-d-learn
Class constructor accept only set if fields like this(string login, string pass) Can I create structure, fill it, and than pass to constructor? Like this: ``` import std.stdio; struct ConnectSettings { string login; string pass; }; ConnectSettings cs; void main() { cs.login =