template typeing issues

BCS ao at pathlink.com
Fri Sep 14 15:40:25 PDT 2007


Is there a better way to get T[] and T[5] to play nice in a template?

void main()
{
	char[] c = "world";
	t("hello", c);
}

void t(T, U)(T a, U  b)
{
	static assert(is(T : U) || is(U : T));
}

my first attempt was this:

void t(T)(T a, T  b) 
{
}

But it wouldn't instance




More information about the Digitalmars-d-learn mailing list