So I wanna find the best possible way of initalizing std:array in below configuration (better way would to be to be able to use cols and rows variables while declaring array size):
class Engine {
protected:
const int rows = 30;
const int cols = 100;
std::array<std::array<int, 100>, 30> arr;
}
How do initalize it properly – I mean my rows and cols are gonna be const, so:
- do I just make row and cols static const and then some initalize arr at compile time with those variables?
- is intalizing arr this way is ok or is it tragic?
Anyway I want to find best possible (like golden standrad) way of initalizing it, while I know how my array will looks like at compile time.
New contributor
djuwaste is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.