On Wed, 27 Oct 2010 22:10:24 -0400, Steven Schveighoffer <[email protected]> wrote:

To answer the OP's question, I don't think there's anything technical restricting the compiler from doing this. I believe it's been proposed several times. If you want to, you can work around the issue by making a wrapper constructor function:

Foo!T makeFoo(T)(T t)
{
   return new Foo!T(t);
}

I should add, it would be ambiguous to do something like this:

class Foo(T, U)
{
   this(T t, U u) {}
   this(U u, T t) {}
}

This kind of situation currently doesn't exist in IFTI, since only templates that have exactly one member and it is a function can participate in IFTI.

But if the classes are made to work in normal cases, then I think IFTI can be extended to support this kind of thing

-Steve

Reply via email to