Why isn't opMul allowed in a const expression

Steven Schveighoffer schveiguy at yahoo.com
Tue Nov 20 07:05:15 PST 2007


I added:

  static X tmpOpMul(X x, int y)
  {
    return X(x.value * y);
  }

To X, and I can do:

static myX4 = X.tmpOpMul(myX, 4);

without error.  I don't see how this is any different than calling opMul. 
It should be evaluatable at compile time, no?

-Steve 





More information about the Digitalmars-d mailing list