On Thursday, 22 February 2018 at 00:13:43 UTC, SrMordred wrote:
string x = "123"; auto c = x.ptr; c++; writeln(c[-1]); // 1 writeln(c[-1..0]); //BOOM Range violationCan I do this / Bug / some mistake ?
youd have to do (c-1)[0 .. 1];
Nicholas Wilson via Digitalmars-d-learn Wed, 21 Feb 2018 16:26:01 -0800
On Thursday, 22 February 2018 at 00:13:43 UTC, SrMordred wrote:
string x = "123"; auto c = x.ptr; c++; writeln(c[-1]); // 1 writeln(c[-1..0]); //BOOM Range violationCan I do this / Bug / some mistake ?
youd have to do (c-1)[0 .. 1];