Class IntMat
| 3 | |
| 4 | // Class IntMat |
| 5 | class IntMat |
| 6 | { |
| 7 | size_t rows; |
| 8 | size_t cols; |
| 9 | int * data; |
| 10 | public: |
| 11 | IntMat(size_t rows, size_t cols): |
| 12 | rows(rows), cols(cols) |
| 13 | { |
| 14 | data = new int[rows * cols]{}; |
| 15 | } |
| 16 | ~IntMat() |
| 17 | { |
| 18 | delete [] data; |
| 19 | } |
| 20 | IntMat(const IntMat&) = delete; |
| 21 | IntMat& operator=(const IntMat&) = delete; |
| 22 | int getElement(size_t r, size_t c); |
| 23 | bool setElement(size_t r, size_t c, int value); |
| 24 | }; |
| 25 | int IntMat::getElement(size_t r, size_t c) |
| 26 | { |
| 27 | if ( r >= this->rows || c >= this->cols) |
nothing calls this directly
no outgoing calls
no test coverage detected