Implicit constructor call

LeoD leo.dahlmann at gmail.com
Fri Jan 12 10:47:08 PST 2007


Hi,
can constructors be called implicit in D? Example:

class Foo
{
	this(int i)
	{

	}
}

void test(Foo f)
{

}

int main()
{
	test(100); // Here Foo.this(100); should get called

	return 0;
}


And why are there no templated constructors in D? Example:

this(T)(T parameter)
{

}



More information about the Digitalmars-d mailing list