less verbose way to declare multidimensional std::array

前端 未结 5 738
再見小時候
再見小時候 2020-12-05 11:11

Short question: Is there a shorter way to do this

array,n>,m> matrix;

I was hoping for something like

5条回答
  •  醉话见心
    2020-12-05 11:53

    A template alias might help out:

    #include 
    
    template 
    using Matrix = std::array, I>;
    
    int main()
    {
        Matrix matrix;
    }
    

提交回复
热议问题