View mode: basic / threaded / horizontal-split · Log in · Help
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
Top | Discussion index | About this forum | D home