Why is the circular buffer not standardized in C++?

3.4k views Asked by At

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.

0

There are 0 answers