when I try to use p1 = p1 +3. It's giving me a no match for operator =
What am I doing wrong?
Thanks again.
/home/greg/workspace/C Part II/finalQ2/main.cpp||In function ‘int main()’:|
/home/greg/workspace/C Part II/finalQ2/main.cpp|20|error: no match for ‘operator=’ in ‘p1 = p1.Point<T>::operator+ [with T = int](3)’|
/home/greg/workspace/C Part II/finalQ2/point.h|72|note: candidates are: Point<T>& Point<T>::operator=(const Point<T>&) [with T = int]|
/home/greg/workspace/C Part II/finalQ2/point.h||In member function ‘T& Point<T>::operator+(T) [with T = int]’:|
/home/greg/workspace/C Part II/finalQ2/main.cpp|20|instantiated from here|
/home/greg/workspace/C Part II/finalQ2/point.h|87|error: invalid initialization of non-const reference of type ‘int&’ from a temporary of type ‘Point<int>’|
||=== Build finished: 2 errors, 0 warnings ===|