3 ms·
> That very thing can easily happen in the real world. Only if badly designed. That is why it is contrived! > While that may seem contrived, consider a vector
by jfkebwjsbx 6y ago
> That very thing can easily happen in the real world.
Only if badly designed. That is why it is contrived!
> While that may seem contrived, consider a vector of 1 million strings, something that's not too uncommon
A program dealing with a million elements of any kind should not be performing naive allocations to begin with.
> we do deallocation trickery in the real world
Skipping deallocations is an optimization, not a design pattern.
In other words, the code needs to keep the ability to perform the deallocation for debugging, testing, usage as a library, etc.