Re: Can we rely on LDC respecting "align" (for avx) ??

2021-09-07 Thread Tejas via Digitalmars-d-learn
On Wednesday, 8 September 2021 at 04:43:31 UTC, Tejas wrote: On Wednesday, 8 September 2021 at 04:32:50 UTC, james.p.leblanc wrote: [...] Yes you are correct (to my understanding) DMD only respects `align` keyword upto the value 16,ie, until `align(16)`, the code behaves the way you expect

Re: Can we rely on LDC respecting "align" (for avx) ??

2021-09-07 Thread Tejas via Digitalmars-d-learn
On Wednesday, 8 September 2021 at 04:32:50 UTC, james.p.leblanc wrote: Dear All, In searching through the forum archives (going back to 2013, 2016 etc), and experiments, it **appears to me** that LDC does indeed respect the standard "align" properties. (Meaning: proper alignment for using

Can we rely on LDC respecting "align" (for avx) ??

2021-09-07 Thread james.p.leblanc via Digitalmars-d-learn
Dear All, In searching through the forum archives (going back to 2013, 2016 etc), and experiments, it **appears to me** that LDC does indeed respect the standard "align" properties. (Meaning: proper alignment for using AVX with static arrays can be guaranteed). Experiments (and forum

Re: Curious effect with traits, meta, and a foreach loop ... mystifies me.

2021-09-07 Thread james.p.leblanc via Digitalmars-d-learn
On Tuesday, 7 September 2021 at 17:33:31 UTC, Adam D Ruppe wrote: On Tuesday, 7 September 2021 at 17:24:34 UTC, james.p.leblanc wrote: If you want to do a runtime lookup, you need to separate the two pieces. This pattern works: switch(runtime_index) { foreach(i, val; item.tupleof)

Re: Curious effect with traits, meta, and a foreach loop ... mystifies me.

2021-09-07 Thread Adam D Ruppe via Digitalmars-d-learn
On Tuesday, 7 September 2021 at 17:24:34 UTC, james.p.leblanc wrote: // this fails with: "Error: variable 'i' cannot be read at compile time // // foreach( i ; 0 .. 3 ){ //ptr = u.tupleof[i].x.ptr; tuples only exist at compile time, so you'd have to make sure the indexing is

Curious effect with traits, meta, and a foreach loop ... mystifies me.

2021-09-07 Thread james.p.leblanc via Digitalmars-d-learn
Dear All, In playing with some reflection and meta programming, this curiosity appeared. Does someone understand what is happening? I would appreciate learning about it if possible. Enclosed code snippet tells the story: ```d import std.stdio; import std.traits; import std.meta; struct

Re: Looking to get typeof parseXML return value

2021-09-07 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 7 September 2021 at 05:00:50 UTC, Chris Piker wrote: On Tuesday, 7 September 2021 at 04:40:25 UTC, jfondren wrote: typeof(parseXML!simpleXML("")) xml; Hey, I like this trick! I was wondering what to use for the const(char)[] variable in the typeof statement. It's

Re: Looking to get typeof parseXML return value

2021-09-07 Thread bauss via Digitalmars-d-learn
On Tuesday, 7 September 2021 at 08:27:33 UTC, JN wrote: On Tuesday, 7 September 2021 at 04:13:08 UTC, Chris Piker wrote: Like almost all new users to D I'm tripping over how to save and pass around variables since nothing has an understandable type anymore and you can't use "auto" for *class

Re: Phobos Unittest

2021-09-07 Thread Per Nordlöw via Digitalmars-d-learn
On Friday, 3 September 2021 at 23:39:44 UTC, Per Nordlöw wrote: When is a phobos unittest supposed to be qualified with version `(StdUnittest)`? Ideally, always? I don't see that their current use is consistenly following a rule. If so, is the purpose of its presence to reduce the burden of

Re: Looking to get typeof parseXML return value

2021-09-07 Thread JN via Digitalmars-d-learn
On Tuesday, 7 September 2021 at 04:13:08 UTC, Chris Piker wrote: Like almost all new users to D I'm tripping over how to save and pass around variables since nothing has an understandable type anymore and you can't use "auto" for *class member* storage types. I struggle with this often.