Struct definition after static if

Zarathustra adam.chrapkowski at gmail.com
Mon Dec 14 09:54:37 PST 2009


Don Wrote:

> Does that compile???   It shouldn't. !< is a floating-point operator.


Of course that compile (thanks Got DMD behaviors logically). In this case !< mean nothing less >= 
NOT GREATER THAN is semantically same as GREATER OR EQUAL.

Yes, you're right !< is a floationg-point operator but it doesn't matter. 

The problem is:
struct B{
  A a;
}

struct A{
}

works ok, but
struct B{
  A a;
}

static if(TRUE) struct A{
}

causes:
  Error: identifier 'A' is not defined
  Error: A is used as a type
  Error: variable B.a voids have no value



More information about the Digitalmars-d-learn mailing list