On Wednesday, 30 January 2013 at 05:44:36 UTC, Zach the Mystic wrote:

Why "alias this" in your version instead of opCall or opGet?

opCall requires parens, probably to disambiguate from alias this.

string A
{
  int i;
  int opCall() { return _i; }

}

A a,

int i = a; // error
int i = a(); // works

You can however do this

alias opCall this;

int i = a; // works
int i = a(); // works too

--rt

Reply via email to