1

In a static container staticMatrix with the following template parameter:

  template<typename T, size_t M, size_t N> 
   staticMatrix{ ... }

I found the following construction that seems to only compile with c++-17.

     template< typename T, size_t M, size_t N >
     StaticMatrix( T (&)[M][N] ) -> StaticMatrix< std::remove_cv_t<T>, M, N >;

How can we understand this constructor and what does the argument T (&) and -> mean ?

A2LBK
  • 1,359
  • 4
  • 15
  • For you first question, see [this](https://stackoverflow.com/questions/10007986/c-pass-an-array-by-reference). For the second, [this](https://en.cppreference.com/w/cpp/language/class_template_argument_deduction#Deduction_for_class_templates) – NathanOliver May 26 '21 at 17:05

0 Answers0