Question about 'this'

Joel via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 2 21:00:28 PDT 2014


	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'?


More information about the Digitalmars-d-learn mailing list