Interfaces and Template Specializations

Björn T. Herzig raichoo at googlemail.com
Sat Jan 10 17:51:36 PST 2009


> Go to the changelog.
> 
> http://www.digitalmars.com/d/2.0/changelog.html

Thanks, downloaded the code but my testcode won't compile

void tester(U)(U u) if(is(U : Plugable) && is(U : Printable))
{
	writefln("U : Printable, Plugable");
	u.plug();
	u.print();
}

void tester(U)(U u)
{
	writefln("Nothing");
}

When calling tester with an object that implements Plugable and Printable it complains that it matches more than one declaration of the template.

Regards,
Björn



More information about the Digitalmars-d mailing list