Я пишу этот конструктор копирования:
//CCtor of RegMatrix
RegMatrix::RegMatrix(const RegMatrix &other){
this-> numRow = other.getRow();
this-> numCol = other.getCol();
//Create
_matrix = createMatrix(other.numRow,other.numCol);
int i,j;
//Copy Matrix
for(i=0;i<numRow; ++i){
for(j=0;j<numCol; ++j){
_matrix[i][j] = other._matrix[i][j];
}
}
}
Есть ли проблема с инициализацией numRow, numCol в списке инициализации, например: numRow (other.numRow), numCol (other.numCol)
вместо:
this-> numRow = other.getRow();
this-> numCol = other.getCol();
Кроме того, я не знаю, нет ли такой проблемы, есть ли проблема с вызовом функции объекта других классов в списке инициализации, например:
numRow(other.getRow())
вместо:
this-> numRow = other.getRow();