Need 'this' to access 'opCall'? Was I trying to?

Mehrdad wfunction at hotmail.com
Mon Sep 26 08:04:05 PDT 2011


struct Adder {
     int v;
     auto opCall(int x) { return x + v; }
}

auto adder(int v) {
     return Adder(v);  // How do I call the constructor??
}

int main() {
     auto a = adder(5);
}


More information about the Digitalmars-d mailing list