Change [] return type to reference

This commit is contained in:
kradchen
2023-05-16 11:10:43 +08:00
parent 21030b554c
commit 846f59edb4
2 changed files with 2 additions and 2 deletions

View File

@@ -470,7 +470,7 @@ namespace Aurora {
return operatorMxA(&vdPowI, times, std::forward<Matrix&&>(matrix));
}
double Matrix::operator[](size_t index) const { return getData()[index];}
double& Matrix::operator[](size_t index) { return getData()[index];}
void Matrix::printf() {
if(isNull())

View File

@@ -170,7 +170,7 @@ namespace Aurora {
Matrix operator==(const Matrix &matrix) const;
// sub
double operator[](size_t index) const;
double& operator[](size_t index);
/**