If I create
std::vector<std::array<double, 2>> points;
std::vector<double> points2;
I know that points2 will be a contiguous chunk of memory holding doubles in the heap. I think that points will be a contiguous chunk of memory of double* to the stack? But will those array be contiguous in the stack? Let's say that I am storing pairs of doubles to represents some points.
points2 is in memory like this: [x0 y0 x1 y1 x2 y2 ...] What about points? What is the best way to store pair of doubles in this case? Thanks for any tip.