Closed abeimler closed 1 year ago
Yes, this has several applications so it would be a nice addition.
Need to think a bit on the semantics and API/supported operations since there is no std
equivalent, but can otherwise be implemented in terms of FixedDeque
.
Regarding API:
boost
has deque API/semantics for circular_buffer
: https://github.com/boostorg/circular_buffer/blob/develop/include/boost/circular_buffer/base.hpp
etl
has queue API/semantics for circular_buffer
: https://www.etlcpp.com/circular_buffer.html
Both are reasonable approaches. To disambiguate, I am thinking of adding both with names FixedCircularDeque
and FixedCircularQueue
, respectively. The latter is a forwarder to the former.
I have adapted your commit from #79 accordingly in #80 @abeimler .
Open to feedback. :)
Done in #80.
Like
FixedVector
(orFixedQueue
?) but with a circular index. Inspiration https://www.etlcpp.com/circular_buffer.htmlExample