Mixin a constructor ?

Jacob Carlborg doob at me.com
Sat Sep 19 08:13:41 PDT 2009


Is it supposed to possible to mixin a constructor? The code below 
doesn't compile. The error: is "main.d(23): Error: constructor 
main.A.this() does not match parameter types (int)
main.d(23): Error: expected 0 arguments, not 1"

template C ()
{
	this (int i)
	{
		
	}
}

class A
{
	mixin C;
	
	this ()
	{
		
	}
}

void main ()
{
	auto a = new A(3);
}



More information about the Digitalmars-d mailing list