Replace PropertyArray with std::array
In PropertyNames.h we define PropertyArray:
struct PropertyArray
{
const Property* properties;
const int length;
PropertyArray(const Property* p, size_t len) : properties(p), length(static_cast<int>(len)) {}
};
I think we should be able to replace this by std::array
I tried to implement this. The issue is that std::array's size is part of the type, eg. std::array<int, 4>. Creating a nested std::array of different sized std::array's isn't possible (which is the case for our property arrays).
I saw a post on stack overflow that seems to work around this using std::span, but that isn't available to us as it requires c++20.
We could switch to using std::vector for everything but not sure that's really preferable. Thoughts?
As mentioned by @externl using std::array doesn't work here, we can keep the current code.