3 ms·
You can't just realloc you way out of your buffer overflow, when this will invalidate existing references to members in the old allocation.
by jstimpfle 2y ago
You can't just realloc you way out of your buffer overflow, when this will invalidate existing references to members in the old allocation.
- MontagFTB 2y agostd::deque doesn’t invalidate existing elements when new ones are added to either end of it. It’s not a panacea, and has its own set of tradeoffs, but if non-invalidation is a requirement for you it is available.