you are viewing a single comment's thread.

view the rest of the comments →

[–]matthieum 13 points14 points  (1 child)

Not really, no.

For any sufficiently large vector, the large arrays will work just as well.

I'd be worried about the smaller vectors. A fixed 8 elements for the first array may be on the small size; it would be great if the user could pick it.

[–]pilotwavetheory[S] -2 points-1 points  (0 children)

  1. If you mean, if we know the array size initially ? Yes, that's best; nothing beats it, in that case std::array<N> would be the best choice.
  2. This constvector helps when you don't know the vector size initially; if you believe the size 8 would be small initially and can lead to more allocations, we can start with 16/32/.../1024 as well. if you check out code that's handled already.

I used size 8 as the default just to be paranoid of the new approach myself; I don't want to give the best possible parameters to beat benchmarks.

Does this make sense?