Recurrence gives incorrect values when the order of previous states is important. eg recurrence!"a[n-1] + a[n-2]"(1,2) works, but recurrence!"a[n-2]"(1,2) does not. fix: void popFront() { _state[_n % stateSize] = binaryFun!(fun, "a", "n")( - cycle(_state, _n), _n + stateSize); + cycle(_state), _n + stateSize); ++_n; } The old values array is being offset twice, remove the argument to cycle and it works perfectly.
http://www.dsource.org/projects/phobos/changeset/1755