On Thursday, 24 October 2013 at 15:40:22 UTC, Dicebot wrote:
On Thursday, 24 October 2013 at 15:36:59 UTC, Chris wrote:
How do you define side effects? After all ranges manipulate, reformat or restructure data.

They should do it in popFront. I'd consider any `front` that does anything but accessing cached value suspicious.

So code like

auto front() {
  doSomething();
  return range[0];
}

should go into

void popFront() {
  doSomething();
  range = range[1..$];
}

Reply via email to