An Impressive Feature Without Doc

Wei Li oldrev at gmail.com
Tue Nov 13 20:36:15 PST 2007


Just a moment ago, I met a cool feature but where is the specs for it?

template Floats(T) {
	static if(is(T : real)) {
		alias T Floats;
	}
}

T min(T=Floats)(T x, T y)  // Why we can write T=Floats instead of T=Floats!(T) ?
{
	return x < y ? x : y;
}

Regards



More information about the Digitalmars-d mailing list