Hey guys, i looked at some sorting examples, and i thought i jsut had to build a comperator which returns bool, in order to keep my list sorted by that value.
here's the relevent code:
and i get:
Error 1 error C3867: 'CityHall::Empl oyeeComp': function call missing argument list; use '&CityHall::Emp loyeeComp' to create a pointer to member.
Error 2 error C2660: 'std::list<_Ty> ::sort' : function does not take 1 arguments.
I know the comperator takes to args, but in all the examples they didn't send any, what should i send it if i should?!
Thank you very much for ur help and time
here's the relevent code:
Code:
bool CityHall::EmployeeComp (Employee *e1,Employee *e2) const { if (e1->GetID()<e2->GetID()) return true; return false; } char** CityHall::PrintAllWorkersByLastName() const { if (m_cityHallWorkers->size()==0) return NULL; m_cityHallWorkers->sort(EmployeeComp); . . .
and i get:
Error 1 error C3867: 'CityHall::Empl oyeeComp': function call missing argument list; use '&CityHall::Emp loyeeComp' to create a pointer to member.
Error 2 error C2660: 'std::list<_Ty> ::sort' : function does not take 1 arguments.
I know the comperator takes to args, but in all the examples they didn't send any, what should i send it if i should?!
Thank you very much for ur help and time
Comment