I want to know the history of the standardization of the circular buffer(circular queue or deque).
AFAIK, the current C++ standard(C++ 2023) doesn't provide a circular buffer in the STL. I googled and found only one proposal, ring_span
around 2015. Boost has the circular_buffer
. Some provide in-house implementations, such as cqueue
.
If you repeat push and pop operations with a std::deque
, you repeat allocating and freeing heap blocks. In Qt(one of largest C++ projects), the situation is worse, where QQueue
keeps allocating heap blocks(and never freeing).
I'm not asking for opinions. I want to know the history. I expect good reasons why it was so hard to standardize the circular buffer.
push
means alsopop
, so the discussions about the interface would be endless. Just some theories. – Verinestd::deque
a ring buffer?" – Parlous