cannot make opDollar work
Andrej Mitrovic
andrej.mitrovich at gmail.com
Sun Dec 12 10:18:06 PST 2010
I think this might have been reported:
http://d.puremagic.com/issues/show_bug.cgi?id=3474
On 12/12/10, spir <denis.spir at gmail.com> wrote:
> 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
>
>
More information about the Digitalmars-d-learn
mailing list