Advertisement
Bisus

Untitled

Aug 31st, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1.     Matrix(const Matrix<T>& other) {
  2.         elem = make_unique<T[other.numRows*other.numColumns]>;
  3.         numRows = other.numRows;
  4.         numColumns = other.numColumns;
  5.  
  6.         for (int i = 0; i!=numRows; ++i)
  7.             for (int j = 0; j!=numColumns; ++j)
  8.                 elem[i*numColumns + j] = other.elem[i*numColumns + j];
  9.  
  10.         return *this;
  11.  
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement