mercredi 9 octobre 2019

Template with default parameters and specialization

I have this piece of code:

template <class T = double>
class Mat {

};

template <>
class Mat<double> {

};

/*****************************************************************************/
// main
/*****************************************************************************/
int main(int argc, char * const argv []) {

  Mat<Mat> Mat;

  return 0;

}

The compiler using -std=gnu++17 give me back:

"Use of class template 'Mat' requires template arguments"

I do not understand why.

Aucun commentaire:

Enregistrer un commentaire