3 ms·
https://en.cppreference.com/w/cpp/container/deque https://en.cppreference.com/w/cpp/container/deque: > When inserting at either end of the deque, references ar
by dzaima 2y ago
https://en.cppreference.com/w/cpp/container/deque https://en.cppreference.com/w/cpp/container/deque:
> When inserting at either end of the deque, references are not invalidated by insert and emplace.
> push_front, push_back, emplace_front and emplace_back do not invalidate any references to elements of the deque.
- rowanG077 2y agoThat's a guarantee of some specific operations on deque not a general requirement on the entirety of deque. I looked at your link and erase_if does not have that requirement. So I'd imagine that can and does invalidate references aka move elements.
- dzaima 2y agoRight, indeed, amluto's comment is incorrectly broad. But it's still a thing that a ring buffer cannot guarantee, but std::deque impls must.