Jonathan M Davis:

> The biggest difference is that a vector has capacity separate from its 
> size/length. You can efficiency insert elements at the end with a vector - 
> amortized constant time usually - but you can't do that with a built-in 
> array because it would have to reallocate every time. D's arrays are 
> fantastic, but they're still not quite good enough to outright replace a 
> vector type.

I can think about the opposite too: to remove the built-in dynamic arrays and 
replace them as it's being done with associative arrays, keeping only the 
syntax sugar and mapping them to the Array/Vector. Is this a bad idea? (this is 
only about dynamic arrays, at the moment built-in fixed-sized arrays have to be 
kept).

Bye,
bearophile

Reply via email to