www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - test if a parameter is a struct

reply Moritz Warning <moritzwarning _nospam_web.de> writes:
I need to test if a template parameter is a struct.
Is there a way to find out?
- thanks
May 19 2008
parent reply Ary Borenszweig <ary esperanto.org.ar> writes:
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
May 19 2008
parent Moritz Warning <moritzwarning _nospam_web.de> writes:
On Tue, 20 May 2008 00:28:27 -0300, Ary Borenszweig wrote:

 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
I didn't thought it would be that easy. :)
May 19 2008