Push into buffer overwriting first element
KovacsGG opened this issue · 2 comments
KovacsGG commented
I want to have the last N number of measurements in my buffer, so it'd be useful to just overwrite old data.
Right now I have to check if my push failed, and do a pop into a dummy variable. I can't manually increment/wrap the read index and decrement size, because those are private.
Is there a better way of doing this? Do you think a forcePush/force method is worthwhile that'd perform the dummy "pop" when full instead of returning false is worthwhile?
Koryphon commented
Hello,
I will look at it today
Best regards