I have a constructor as such:
class MyClass {
protected:
std::size_t size1;
std::size_t size2;
std::array<std::array<std::pair<std::uint64_t, std::uint64_t>>> items;
public:
MyClass(): MyClass(1, 1, <???>) {}
MyClass(std::size_t size1, std::size_t size2): size1(size1), size2(size2), <???> {}
};
I'm not sure if the above part can be done: to initialize the array of arrays of pairs to all 0 based on the sizes provided by size1 and size2. I've Googled around a bit but can't seem to run into code examples of this. Any help would be appreciated.
std::arraysize is fixed and must be known at compile time. You might want to usestd::vectorinstead.std::vector, but usually only when the maximum possible size is fairly small.