24 Jan
2017
24 Jan
'17
3:28 p.m.
On Wed, Jan 18, 2017 at 12:00 PM, Robert Dailey
I'm using circular_buffer to represent a FIFO queue of bytes:
boost::circular_bufferstd::uint8_t m_queue;
When I read bytes from the "front", I simply do:
m_queue.erase_begin(num_read_bytes);
I do so because the documentation for erase_begin() specifically mentions constant time performance for scalar types since no destructor needs to be called.
However, I feel that rotate() better expresses what I'm trying to do. Is there a reason to prefer one over the other for scalar types?
Would it be possible to get some feedback on this?