question about property for built-in type

%u djvsrose at
Fri Oct 8 05:19:43 PDT 2010

I'm learning D right now and got a question about property.
I tried to add a property for built-in type like the following

@property bool equalZero(double a) { return a == 0.0; }

void main()
  double x = 4.4;
  bool isXZero = x.equalZero;

but got an error message
main.d(75): Error: no property 'equalZero' for type 'double'

I tried similar thing with int[] and it works.
Is that I did something wrong or property does not support built-in type like
double, int, real, ...?

Appreciate for your time and answer.

More information about the Digitalmars-d-learn mailing list