A circular buffer implementation in C++