The OpenD Programming Language

TemplateOf

Returns an alias to the template that T is an instance of. It will return void if a symbol without a template is given.

  1. alias TemplateOf(alias T : Base!Args, alias Base, Args...) = Base
  2. alias TemplateOf(T : Base!Args, alias Base, Args...) = Base
    import std.traits;
    alias TemplateOf(T : Base!Args, alias Base, Args...) = Base
  3. alias TemplateOf(T) = void

Examples

struct Foo(T, U) {}
static assert(__traits(isSame, TemplateOf!(Foo!(int, real)), Foo));

Meta