test if a parameter is a struct

Ary Borenszweig ary at esperanto.org.ar
Mon May 19 20:28:27 PDT 2008


Moritz Warning escribió:
> I need to test if a template parameter is a struct.
> Is there a way to find out?
> - thanks

template Foo(T) {
     static if(is(T == struct)) {
     }
}

http://digitalmars.com/d/1.0/expression.html#IsExpression



More information about the Digitalmars-d mailing list