Guest User

Untitled

a guest
Dec 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. /**
  2. * Add two polynomials together
  3. *
  4. * @overload operator +=
  5. * @return A refrence to this object
  6. */
  7. const Polynomial& Polynomial::operator +=(const Polynomial& other)
  8. {
  9. std::vector<double> test(1,1);
  10.  
  11. std::cout << test[0] << '\n';
  12.  
  13. test[0] = 5;
  14.  
  15. std::cout << test[0] << '\n';
  16.  
  17.  
  18. // Add the vectors together
  19. for(int i = 0; i < this->terms.size(); ++i)
  20. this->terms[i] += other.terms[i];
  21.  
  22. return *this;
  23. }
Add Comment
Please, Sign In to add comment