April 30, 2004 static/not static overloads | ||||
|---|---|---|---|---|
| ||||
class A {
void foo() {
printf("nonstatic\n");
}
static void foo(int x) {
printf("static foo %i\n", x);
}
}
int main() {
A a = new A();
A.foo(4); // line 14
}
test.d(14): 'this' is only allowed in non-static member functions
-- andy
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply