static if check for array and AA

Tom S h3r3tic at remove.mat.uni.torun.pl
Wed Jun 21 15:46:56 PDT 2006


How bout this ?



// ----
import std.stdio;


void main() {
	alias char[][int[]] Foo;

	static if (is(typeof(Foo.keys))) {
		static if (is(typeof(Foo.values))) {
			static if (is(Foo : typeof(Foo.values[0])[typeof(Foo.keys[0])])) {
				writefln("AA !");
			} else writefln("!AA3");
		} else writefln("!AA2");
	} else writefln("!AA1");
}
// ----


-- 
Tomasz Stachowiak  /+ a.k.a. h3r3tic +/



More information about the Digitalmars-d mailing list