On Fri, Jan 1, 2010 at 17:26, Lars T. Kyllingstad
<[email protected]> wrote:

>  // Does T end up being the array or element type here?
>  template Foo(T: T[]) { ... }
>
>
Yeah, me too. So I end up putting external constraints and static ifs
everywhere:

template Foo(T) if isDynamicArray!T {
    alias ElementType!T E;
}

>// How many template parameters do I have to specify when
>// instantiating this template?
> template Bar(T: U*, U: int) { ... }

And is it the same than template Bar(U: int, T: U*) {...}?

Some others of the same kind:

why, to test if type U is a composite type (Cycle!(T), for example), do I
have to write
is(U u == Cycle!T, T)
and not
is(U == Cycle!T, T)? (If I'm not mistaken).
And to detect if some type is a std.typcons.tuple with
 is(T t = Tuple!U, U...)
doesn't work, because the is() doesn't accept variadic template arguments.
Too bad.

Reply via email to