Greetings<div><br></div><div>What would be the form of "is" expression to match with a Variadic Template Class?</div><div>I am pasting a simple example below to clarify my need. I need an is expression to match with the Bar(T...) type in the code below.</div>
<div><br></div><div>Regards</div><div>- Puneet</div><div><br></div><div><div>class Foo(int N=0) {}</div><div><br></div><div>class Bar(T...) {}</div><div><br></div><div>void foobar(L) (ref L l)</div><div> if(is(L f : Foo!N, int N))</div>
<div> {</div><div> import std.stdio;</div><div> writeln("Matched a Foo(int N)");</div><div> }</div><div><br></div><div>void foobar(L) (ref L l)</div><div> if // WHAT IS EXPRESSION SHOULD COME HERE</div>
<div> {</div><div> import std.stdio;</div><div> writeln("Matched a Bar(T...)");</div><div> }</div><div><br></div><div>void main() {</div><div> Foo!0 foo = new Foo!0();</div><div> Bar!() bar = new Bar!();</div>
<div> foobar(foo);</div><div> foobar(bar);</div><div>}</div></div><div><br></div>