template type check syntax

Gzp galap at freemail.hu
Sat Nov 21 09:17:20 PST 2009


> 
> void foo(T)(ref T t) if (isPrime!(T)) { ... }
> void foo(T)(ref T t) if (!isPrime!(T)) { ... }
> 

What is the difference b/n
void foo(T)(ref T t) if (isPrime!(T)) { ... }
and
void foo(T)(ref T t) static if (isPrime!(T)) { ... }
as both of them seems to be a compile time check for me.

Thanks, Gzp


More information about the Digitalmars-d-learn mailing list