Re: Can you tell if an template alias parameter is of a specific template?

2018-08-05 Thread aliak via Digitalmars-d-learn
On Saturday, 4 August 2018 at 12:54:49 UTC, Steven Schveighoffer wrote: Once you have an alias, it's the original thing in all respects. So there's no way to get the specific alias that was used. That's not a bug, but a feature. Aha. Thanks. I've tried std.traits.TemplateOf and

Re: Can you tell if an template alias parameter is of a specific template?

2018-08-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/3/18 12:17 PM, aliak wrote: Hi Is there a way to tell if an alias is to a template? I'm writing some algorithms and I need to distinguish between a binary predicate that provides "less than" and one that provides "equal to" semantics. So I have these two templates: template eq(alias

Re: Can you tell if an template alias parameter is of a specific template?

2018-08-03 Thread aliak via Digitalmars-d-learn
On Friday, 3 August 2018 at 19:10:45 UTC, Hakan Aras wrote: I don't think you can distinguish between entities evaluated through different templates. TemplateOf will paradoxically not work on pure templates of the form "template X() {}" only things like template functions and template structs.

Re: Can you tell if an template alias parameter is of a specific template?

2018-08-03 Thread Hakan Aras via Digitalmars-d-learn
I don't think you can distinguish between entities evaluated through different templates. TemplateOf will paradoxically not work on pure templates of the form "template X() {}" only things like template functions and template structs. isSame, is, and isInstanceOf will only work on the fully

Can you tell if an template alias parameter is of a specific template?

2018-08-03 Thread aliak via Digitalmars-d-learn
Hi Is there a way to tell if an alias is to a template? I'm writing some algorithms and I need to distinguish between a binary predicate that provides "less than" and one that provides "equal to" semantics. So I have these two templates: template eq(alias pred) { alias eq = pred; }