Open chipbarnaby opened 3 years ago
My understanding is that arrays need to know their length at compile time. I'm not sure we can know that for any of our vectors.
Arrays can be allocated on the heap at run time. They just cannot change size once allocated.
@tanaya-bigladder thoughts on this?
std::array<T,N> is a template, so the element type and size have to be known at compile time. I'd imagine anything that can be expressed as a constexpr is allowed for the size template parameter, but we couldn't, say, read in the number of axes from an RS and then initialize a std::array<Axes,N> at that point in the runtime code. The only STL container I've ever used that way is a vector.
@chipbarnaby are you suggesting that we use C-style arrays?
Same problem, though. You can't initialize a C array with a non-const size.
There may be ways to use arrays as opposed to vectors. Reduced memory management overhead on caller side?