Greeting.
I tried to compile this code with DMD 2.053:
@property bool isZero(float value)
{
return value float.epsilon;
}
void main()
{
0.1f.isZero;
readln();
}
But the compiler said,
no property 'isZero' for type 'float'.
I cannot understand this error.
hi there, please read this code:
import std.stdio;
struct test(T)
{
alias typeof(*this) type;
T a;
}
void main()
{
test!(int).type t;
t.a = 123;
writeln(t.a);
}
I guessed it would work. but the compiler said:
main.d(7): Error: can only * a pointer, not a 'test!(int)'
main.d(14): Error: