calling functions without parentheses

Adam Cigánek adam.ciganek at gmail.com
Mon Nov 8 11:48:20 PST 2010


Hello,

It seems that if function has no parameters, it's possible to omit the
parentheses when calling it:

    string sayHello() {
      return "hello";
    }

    void main() {
      writeln(sayHello); // same as writeln(sayHello());
    }

Is this an actual defined (and documented) behaviour that I can expect
to keep working in the future, or just some random unintended side
effect which might disappear in a next version?


adam.


More information about the Digitalmars-d-learn mailing list