4 ms·
Is that an actual guarantee or just the current implementation? I'd expected that at the very least some functions that can operate on std::deque must require m
by rowanG077 2y ago
Is that an actual guarantee or just the current implementation? I'd expected that at the very least some functions that can operate on std::deque must require moves. erase_if immediately comes to mind.
- dzaima 2y agohttps://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.