I keep getting errors from trying to set up a operator overloading function. The gist of the program is to sort arrays of two different data structures, by comparing a specif member of said structures. I have no idea what's wrong this is my first time using member functions/operator overloading.
templates.hpp
-------------
line 3: SArray is passed by value. The function is operating on a copy of the array. The sorted copy goes out of scope when the function exits. SArray should be passed by reference.
Lines 6,8: The termination condition of your for loops are incorrect. They should be: i<size
Lines 10,12,13: Are going to cause an out of bounds condition. j+1 is going to be out of bounds on the last iteration of the inner loop.
I applied those fixes.
I'm getting errors retaining to the assignment (=) operation overload.
Error:Prototype for 'void Trashpile::operator=(const Trashpile& rhs)' does not match any in class
Error: candidate is: void Trashpile::operator=(const Trashpile& rhs)