Re: Detecting manifest contants

2022-03-13 Thread Basile B. via Digitalmars-d-learn
On Saturday, 12 March 2022 at 18:49:32 UTC, Anonymouse wrote: I'm introspecting structs, and I ran into an issue where `__traits(derivedMembers)` includes manifest constant enums in the returned tuple. What is the correct way to statically detect these? The immediate thing that springs to mi

Re: Detecting manifest contants

2022-03-12 Thread Anonymouse via Digitalmars-d-learn
On Saturday, 12 March 2022 at 19:01:06 UTC, Paul Backus wrote: Typo: `.tupleof` I use `.tupleof` otherwise, but this is old stuff from when I didn't know of it. I'll have to refactor it some day, I had hoped for it to be just... not yet.

Re: Detecting manifest contants

2022-03-12 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 12 March 2022 at 19:00:23 UTC, Paul Backus wrote: On Saturday, 12 March 2022 at 18:49:32 UTC, Anonymouse wrote: Currently I'm testing if a function that takes the address of the member compiles, and I think it works, but like with everything `__traits(compiles)` it strikes me as

Re: Detecting manifest contants

2022-03-12 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 12 March 2022 at 18:49:32 UTC, Anonymouse wrote: Currently I'm testing if a function that takes the address of the member compiles, and I think it works, but like with everything `__traits(compiles)` it strikes me as it might not be the right way to go about things. It sounds l

Detecting manifest contants

2022-03-12 Thread Anonymouse via Digitalmars-d-learn
I'm introspecting structs, and I ran into an issue where `__traits(derivedMembers)` includes manifest constant enums in the returned tuple. What is the correct way to statically detect these? The immediate thing that springs to mind is `is(symbol == enum)`, but it's not it. Currently I'm t