Static if to compare two types are the exact same
w0rp via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Apr 7 00:26:22 PDT 2015
On Tuesday, 7 April 2015 at 06:37:50 UTC, Jonathan wrote:
>>> static if (is(T == V))
>
> Are static ifs always checked outside of runtime? Is it
> possible for a static if condition to be undeterminable outside
> of runtime, or would such a condition throw a compiler error?
'static if' is always run at compile time, so it needs access to
compile time information. Fortunately, you can access quite a lot
at compile time in D.
More information about the Digitalmars-d-learn
mailing list