Uniform call syntax for operator overloads

bearophile bearophileHUGS at lycos.com
Sun Jul 25 06:42:39 PDT 2010


Tomek S.:

> This doesn't work:
> int opIndex(int[][] m, uint i, uint j) { return m[i][j]; }

That's cute, but in D overloaded operator can be defined inside structs/classes/unions only (this is different from C++).

Bye,
bearophile


More information about the Digitalmars-d mailing list