use default constructors and skip unnecessary initialization

This commit is contained in:
Daniel Agar
2018-08-31 08:11:02 +02:00
committed by Beat Küng
parent 1bcf48bd82
commit f1bee775a0
11 changed files with 37 additions and 70 deletions
+5 -5
View File
@@ -30,22 +30,22 @@ class Matrix
public:
Type _data[M][N];
Type _data[M][N] {};
// Constructors
Matrix() : _data() {}
Matrix() = default;
Matrix(const Type data_[][N]) : _data()
Matrix(const Type data_[][N])
{
memcpy(_data, data_, sizeof(_data));
}
Matrix(const Type *data_) : _data()
Matrix(const Type *data_)
{
memcpy(_data, data_, sizeof(_data));
}
Matrix(const Matrix &other) : _data()
Matrix(const Matrix &other)
{
memcpy(_data, other._data, sizeof(_data));
}