An Impressive Feature Without Doc

Wei Li oldrev at gmail.com
Tue Nov 13 22:01:18 PST 2007


Wei Li Wrote:

> 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

Sorry, my fault. I'm confused it with ':'.

Regards




More information about the Digitalmars-d mailing list