We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This works for me. The r.a = this->a created a reference point which will permit in avoiding the overload of recreating another matrix with all the rows and columns.
Operator Overloading
You are viewing a single comment's thread. Return to all comments →
This works for me. The r.a = this->a created a reference point which will permit in avoiding the overload of recreating another matrix with all the rows and columns.
class Matrix { public: vector> a; Matrix(){}; Matrix operator +(Matrix const &x){ Matrix r; r.a = this->a;
};