Update Array2D.hpp

main
p68710245 1 year ago
parent b24c71981f
commit 2136601f1f

@ -33,7 +33,7 @@ public:
std::cout << '\n'; std::cout << '\n';
} }
} }
int *operator[](int i) // 重载[],允许暴露内部数据 int *operator[](int i) const// 重载[],允许暴露内部数据
{ {
if (i < 0 || i >= row) if (i < 0 || i >= row)
throw std::out_of_range{"数组行下标越界\n"}; throw std::out_of_range{"数组行下标越界\n"};

Loading…
Cancel
Save