<div class="gmail_quote">On Fri, Jan 1, 2010 at 17:26, Lars T. Kyllingstad <span dir="ltr">&lt;public@kyllingen.nospamnet&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div> // Does T end up being the array or element type here?<br></div>
  template Foo(T: T[]) { ... }<br> 

 <br></blockquote><div>Yeah, me too. So I end up putting external constraints and static ifs everywhere:<br><br>template Foo(T) if isDynamicArray!T {<br>    alias ElementType!T E;<br>}<br><br>&gt;// How many template parameters do I have to specify when<br>
&gt;// instantiating this template?<br>&gt; template Bar(T: U*, U: int) { ... <font color="#888888">}</font><br>
<br>And is it the same than template Bar(U: int, T: U*) {...}?<br><br>Some others of the same kind:<br><br>why, to test if type U is a composite type (Cycle!(T), for example), do I have to write <br>is(U u == Cycle!T, T) <br>
and not <br>is(U == Cycle!T, T)? (If I&#39;m not mistaken).<br>And to detect if some type is a std.typcons.tuple with <br> is(T t = Tuple!U, U...) <br>doesn&#39;t work, because the is() doesn&#39;t accept variadic template arguments. Too bad.<br>
<br><br><br><br><br><br><br><br></div></div>