Uniform call syntax for operator overloads

Tomek Sowiński just at ask.me
Sun Jul 25 06:39:15 PDT 2010


This doesn't work:

int opIndex(int[][] m, uint i, uint j) { return m[i][j]; }

unittest {
    auto m = [[9,8], [2,3]];
    auto a = m[0,1];
}

It's so by design or by bug?


Tomek

p.s. Where on D page is uniform call syntax documented? Couldn't find it in 
functions section.


More information about the Digitalmars-d mailing list