pushback adds element out of bound for a circular buffer [ _ 3 ] when head and tail poits to '3' How to reproduce:
circular_buffer<int, 3> cb {{1,2,3}};
assert(cb.pop_front() == 1);
assert(cb.pop_front() == 2);
cb.pushback(4);
assert(cb[0] == 3);
assert(cb[1] == 4); // <<- '4' pushes to tail=3
This commit updates tail_ according to circular buffer expectations
pushback adds element out of bound for a circular buffer [ _ 3 ] when head and tail poits to '3' How to reproduce: circular_buffer<int, 3> cb {{1,2,3}}; assert(cb.pop_front() == 1); assert(cb.pop_front() == 2); cb.pushback(4); assert(cb[0] == 3); assert(cb[1] == 4); // <<- '4' pushes to tail=3
This commit updates tail_ according to circular buffer expectations