How to pass array of arrays to a template class with non-type parameters

  braces, c++, initialization-list, stdarray

I would assume the below code would work to initialize the Matrix class, but for Matrix C I get the following:

error C2440: ‘initializing’: cannot convert from ‘initializer list’ to ‘Math::Linear::Matrix<int,2,2>’

        template<class T, unsigned int Rows, unsigned int Cols>
        class Matrix
        {
        public:
            Matrix(std::array<std::array<T,Cols>,Rows> ArrayArray)
            {
            
            }
        }

    std::array<std::array<int, 2>, 2> A = {{ {{1,1}} , {{1,1}} }};
    Matrix<int, 2, 2> B = A;
    Matrix<int, 2, 2> C = {{ {{1,1}} , {{1,1}} }};

Source: Windows Questions C++

LEAVE A COMMENT