bloomen / circbuf

A circular buffer for C++20

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

circbuf

Actions

A circular buffer with a capacity fixed at compile time. Requires C++20 and is tested with Clang, GCC, and Visual Studio. CircularBuffer has a standard-compliant interface and can be used with ranges and within consteval contexts.

Sample usage:

CircularBuffer<int, 3> cb;
cb.push_back(42);
cb.push_back(43);
cb.push_back(44);
cb.push_back(45);
for (auto value : cb)
{
    std::cout << value << " ";
}
// prints: 43 44 45

About

A circular buffer for C++20

License:MIT License


Languages

Language:C++ 99.8%Language:CMake 0.2%