Open smbanasik opened 3 months ago
We'll likely need to use two pointers (front and back), as well as having an element after the real end of the queue, which is a requirement for resolving the start == end
issue, and enables this container to be used with iterators.
I dislike the extra element, since the element's size scales with the size of the templated type, but without manually managing the memory of the area (void*
implementation), I don't think much can be done about it.
Since the usefulness of such a data type would be best with a stream of data (e.g. UDP, where data can be lost), and streaming large objects would be goofy, I think this compromise is fine.
The circular queue would be a fixed size queue that, when the maximum count has been reached, would loop back and overwrite the first element.