C
Chameleon
With g++ I have this error when I compile:
----------crap.cpp--------------------------------------------------------
struct A {
static const double CRAP = 1;
A() { double a = - CRAP / 2; } // Undefined reference to A::CRAP
A(int) { double a = - (CRAP / 2); }
};
int main() {
A a;
A b(0);
return 0;
}
----------crap.cpp--------------------------------------------------------
struct A {
static const double CRAP = 1;
A() { double a = - CRAP / 2; } // Undefined reference to A::CRAP
A(int) { double a = - (CRAP / 2); }
};
int main() {
A a;
A b(0);
return 0;
}