Facing problems with Class Properties

Jesse Phillips jessekphillips+D at gmail.com
Fri Dec 10 12:08:34 PST 2010


Jesse Phillips Wrote:

> typeof() and is() are compile time constructs. Change your if statements to
> static if.

Just realized what the issue is. You are creating code as foreach becomes a static foreach when iterating a tupleof. (Yes steven it does work)

This you are building code which looks like

if(false) {
    for (size_t j = 0; j < f.length...)
    ...
}

Semantically this code is wrong as you can't take the length of f which is class Bar. The static if forces the compiler to not generate this code as it is known to be false.


More information about the Digitalmars-d-learn mailing list