template specialization

Thorsten thorstenkiefer at gmx.de
Sat Mar 3 16:04:07 PST 2007


Hi, when I compile this :

template toString(T) {
	char[] toString(T x){
		return "<??>";
	}
}
template toString(T : T[]) {
	char[] toString(T[] x){
		return "<array>";
	}
}

, I get this : 
tools.d(162): template tools.toString(T : T[]) specialization not allowed for deduced parameter T

According to the online manual this should be no error.
How can I solve this ?




More information about the Digitalmars-d mailing list