Argument not match

Tom Tom_member at pathlink.com
Thu Mar 16 05:13:48 PST 2006


In article <dvanu3$1krf$1 at digitaldaemon.com>, Li Jie says...
>
>CODE:
>-------------------------
>template Test(T)
>{
>void Test(char[] name, T value)
>{
>writefln("Test");
>}
>}
>
>// in main
>Test("hello", 5);
>-------------------------
>
>Compile it, I get some errors:
>main.d(73): template main.Test(T) does not match any template declaration
>main.d(73): template main.Test(T) cannot deduce template function from argument
>types (char[5],int)

# import std.stdio;
# 
# template Test(T)
# {
# 	void Test(char[] name, T value)
# 	{
# 		writefln("Test");
# 	}
# }
# 
# int main()
# {
# 	Test!(int)("hello", 5);
# 
# 	return 0;
# }

This compiles fine. Not sure what you're trying to do.

Tom;



More information about the Digitalmars-d mailing list