Template declaration doesn't match

tcak tcak at pcak.com
Sun Feb 9 11:16:34 PST 2014


I started writing a piece code today. It is as following.

class Test{
	public enum DATA_LENGTH = 16;

	public static void foo( T )( in T[DATA_LENGTH] msg ) if( is(T: 
ubyte) || is(T: char)){
		//...
	}

	public static void bar( in ubyte[DATA_LENGTH] msg ){
		//...
	}
}

void main(){
	ubyte[ Test.DATA_LENGTH ] msg;

	Test.foo( msg ); // error: template bugtest.Test.foo does not 
match any function template declaration.

	Test.bar( msg ); // ok. works
}

If I call `foo`, it gives error as noted. I am on Ubuntu 13.10 
64-bit, DMD 2.064.2.

Is that error normal and I am missing something? or a bug?


More information about the Digitalmars-d mailing list