15 Jun
2020
15 Jun
'20
4:31 p.m.
Andrey Semashev wrote:
I'd prefer containers and not queues though. That is, {push,pop}_{front,back} instead of push/pop. "Ring deque".
Containers are less appealing for the ring design because erasing and inserting at arbitrary position will be inefficient. Though the same is also true for std::deque and std::vector...
Erasing/inserting at begin()+k for small k will be considerably more efficient than vector.