Re: How to check for instantiation of specific template?

2013-10-11 Thread Dicebot
This is actually a very interesting question. Usual approach is to use pattern matching on types but template instance symbol is not a type on its own, it is just a symbol. (with typeof == void) My second guess was to check __traits(identifier, AliasParam) but it looks like for aliased insta

Re: How to check for instantiation of specific template?

2013-10-11 Thread Jacob Carlborg
On 2013-10-10 19:23, H. S. Teoh wrote: I have a template used for storing compile-time values: template Def(int x, string y) { alias impl = TypeTuple!(x,y); } How do I define a template isDef that, given some template alias A, evaluates to true if A is some insta

Re: How to check for instantiation of specific template?

2013-10-10 Thread simendsjo
On Thursday, 10 October 2013 at 17:24:37 UTC, H. S. Teoh wrote: I have a template used for storing compile-time values: template Def(int x, string y) { alias impl = TypeTuple!(x,y); } How do I define a template isDef that, given some template alias A, evaluates

Re: How to check for instantiation of specific template?

2013-10-10 Thread Simen Kjaeraas
On 2013-10-10, 19:23, H. S. Teoh wrote: I have a template used for storing compile-time values: template Def(int x, string y) { alias impl = TypeTuple!(x,y); } How do I define a template isDef that, given some template alias A, evaluates to true if A is some ins

How to check for instantiation of specific template?

2013-10-10 Thread H. S. Teoh
I have a template used for storing compile-time values: template Def(int x, string y) { alias impl = TypeTuple!(x,y); } How do I define a template isDef that, given some template alias A, evaluates to true if A is some instantiation of Def? template isDef(