Это измененная версия вашего кода, которая только работает.
#include <iostream>
#include <array>
#include <cmath>
#include <initializer_list>
#include <vector>
using namespace std;
class Matrice33
{
public:
Matrice33(double a = 1, double b = 1, double c = 1)
: matrice{{ {{a, 0, 0}}, {{0, b, 0}}, {{0, 0, c}} }}
{
}
Matrice33(const std::initializer_list<std::initializer_list<double>> & coeff)
{
int counter = 0;
for (auto row : coeff)
{
copy(row.begin(), row.end(), matrice[counter++].begin());
}
}
void affiche()
{
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
cout << matrice[i][j] << " ";
}
cout << endl;;
}
}
private:
array<array<double, 3>, 3> matrice;
};
int main()
{
Matrice33 mat{ {1.1, 1.2, 1.3},{2.1, 2.2, 2.3},{3.1, 3.2, 3.3} };
mat.affiche();
Matrice33 m(2.0, 3.0, 1.0);
m.affiche();
return 0;
}