isTemplateInstance

Detects wether T is an instantiated template.

  1. template isTemplateInstance(alias T : Base!Args, alias Base, Args...)
    template isTemplateInstance (
    alias T : Base!Args
    alias Base
    Args...
    ) {
    enum isTemplateInstance;
    }
  2. template isTemplateInstance(T : Base!Args, alias Base, Args...)
  3. template isTemplateInstance(T)
  4. template isTemplateInstance(alias T)

Examples

1 enum a(T) = false;
2 void b(T)(int){}
3 void c()(){}
4 template d(T){}
5 class e(T){T t;}
6 interface I{}
7 
8 static assert(isTemplateInstance!(a!int));
9 static assert(isTemplateInstance!(b!int));
10 static assert(isTemplateInstance!(d!int));
11 static assert(isTemplateInstance!(e!int));
12 
13 static assert(!isTemplateInstance!(I));
14 static assert(!isTemplateInstance!(int));
15 
16 static assert(!isTemplateInstance!(a));
17 static assert(!isTemplateInstance!(b));
18 static assert(!isTemplateInstance!(c));

Meta