Weird template instantiation problem

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 12 12:21:45 PDT 2017


more funny compiler messages:

	alias xx = size_t function (int[]);
	struct S1(T, typeof(xx) X) {}
	void main() {
	  S1!(int, defaultChooser!int) s;
	}

Error: type uint function(int[]) is not an expression

but:

	struct S2(T, typeof(defaultChooser!T) chooser=defaultChooser!T) {}
	void main() {
	  S2!int s;
	}

Error: undefined identifier T

error messages are totally random (and why `typeof()` is not allowed there?)


More information about the Digitalmars-d-learn mailing list