Question about 'this'
Joel via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Sep 2 21:25:23 PDT 2014
On Wednesday, 3 September 2014 at 04:00:30 UTC, Joel wrote:
> string getString2(in string input) {
> long start, end;
> while(start < input.length && input[start] != '"')
> start++;
> start++;
> end = input.length - 1;
> while(end > 0 && input[end] != '"')
> end--;
> end--;
>
> return input[start .. end];
> }
>
> unittest {
> (543) writeln(getString2(`st"1 2 3"`));
> }
>
> control.d(543): Error: 'this' is only defined in non-static
> member functions, not __unittestL542_3
>
> What does it mean about 'this'?
Oh, I get it now. It's in a struct scope.
More information about the Digitalmars-d-learn
mailing list