We could use a good Vector class to replace Array, QPtrVector, QValueVector, and one-off hacks to do resizable buffers or static stack buffers. Attached is my first cut at this. It should be really efficient for both POD and non-POD types, and supports an inline buffer for "fixed-size stack buffer" use cases. Potentially useful things that are not in this version (yet): - detecting allocation failures - versions of fill, the constructor and append which take start and end iterators - fill-style append - swap - generalized insert/remove (won't add these until it is clear they are needed) - reverse iterators (is this really at all useful?) - optional bounds checking w/ compile time switch - debug mode iterator checking like for HashTable
Created attachment 6055 [details] implement Vector
Comment on attachment 6055 [details] implement Vector r=me, since you're turning it on and actually using it, make sure to run perf tests. We want to be really sure it's fast.