3 ms·
Changing the allocator changes the type of the vector, which has ABI/API implications, especially if the vector type is not under your control. Also, IMHO tyin
by gpderetta 8y ago
Changing the allocator changes the type of the vector, which has ABI/API implications, especially if the vector type is not under your control.
Also, IMHO tying allocation with initialization in the allocator concept is not one of C++ brightest moments.
There have been continuous talks about adding an unsafe_push_back and an unsafe resize for these and other reasons.
- stochastic_monk 8y agoI have written custom containers with malloc/realloc/placement new. It’s a hassle, but once it works, you have a very efficient and memory-safe implementation.