December 12, 2010 cannot make opDollar work | ||||
---|---|---|---|---|
| ||||
Hello, Test case: struct S { int[] ints; int opDollar () {return this.ints.length;} int opIndex (int i) {return this.ints[i];} int[] opSlice (int i, int j) {return this.ints[i..j];} } unittest { S s = S([3,2,1]); // _link_ error on each line: // Error: undefined identifier __dollar writeln(s[$-1]); writeln(s[0..$]); writeln(s[1..$-1]); } Thank you, Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com |
Copyright © 1999-2021 by the D Language Foundation