Re: How get struct value by member name string ?

2023-06-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/31/23 12:08 AM, John Xu wrote: When render vibe.d diet template,     string[] allMembers = __traits(allMembers, t); enum allMembers = __traits(allMembers, t);     res.render!("index.dt", t, allMembers) if I don't want write memberName one by one in diet template:     table  

Re: Indenting standards religions K, whitesmiths etc

2023-06-01 Thread Cecil Ward via Digitalmars-d-learn
On Thursday, 1 June 2023 at 09:37:43 UTC, Dukc wrote: On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote: I wanted to ask how some of the leaders of our group feel about D indentation standards. `i realise that this causes some religious fervour in C. I could be in trouble here

Re: How static link dll msvcr120.dll?

2023-06-01 Thread Marcone via Digitalmars-d-learn
On Tuesday, 30 May 2023 at 05:18:11 UTC, novice2 wrote: you cannot "static link dll", "d" in "dll" is "dynamic". you can implicity or explicity load dll. https://learn.microsoft.com/en-us/cpp/build/linking-an-executable-to-a-dll?view=msvc-170 may be you mean static link msvcr120.lib? i am not

Re: How static link dll msvcr120.dll?

2023-06-01 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 1 June 2023 at 15:05:40 UTC, Marcone wrote: I linked msvcr120.lib, but the executable still ask for msvcr120.dll not found. msvcr120.lib is a "link library", not a static library. On other systems, you pass shared libraries directly to the linker and it will pull the

Re: Indenting standards religions K, whitesmiths etc

2023-06-01 Thread Cecil Ward via Digitalmars-d-learn
On Thursday, 1 June 2023 at 09:37:43 UTC, Dukc wrote: On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote: I wanted to ask how some of the leaders of our group feel about D indentation standards. `i realise that this causes some religious fervour in C. I could be in trouble here

Re: How static link dll msvcr120.dll?

2023-06-01 Thread novice2 via Digitalmars-d-learn
On Thursday, 1 June 2023 at 15:05:40 UTC, Marcone wrote: I linked msvcr120.lib, but the executable still ask for msvcr120.dll not found. i am sorry. my words was sourced from common sence, usual practice. it seems, msvcr120 is special case, and have only one version of .lib - for link to

Re: How get struct value by member name string ?

2023-06-01 Thread John Xu via Digitalmars-d-learn
A correction: string getTMember(T t, string columnName) { foreach(member; __traits(allMembers, T)){ if (member == columnName) { return __traits(getMember, t, member).to!string; } } return ""; }

Re: How get struct value by member name string ?

2023-06-01 Thread John Xu via Digitalmars-d-learn
On Thursday, 1 June 2023 at 15:38:08 UTC, Steven Schveighoffer wrote: On 5/31/23 12:08 AM, John Xu wrote: When render vibe.d diet template,     string[] allMembers = __traits(allMembers, t); enum allMembers = __traits(allMembers, t);     res.render!("index.dt", t, allMembers) if I

Re: Indenting standards religions K, whitesmiths etc

2023-06-01 Thread Dukc via Digitalmars-d-learn
On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote: I wanted to ask how some of the leaders of our group feel about D indentation standards. `i realise that this causes some religious fervour in C. I could be in trouble here because in all my years at work, we never used K & R ‘one