Virtual methods as Comp function to sort
- by wilsongoncalo.mp
Hello everyone!
I'm new to C++ and i'm trying to use std::sort function to sort a vector of Solutions.
The code is something like this (solution list is a *vector):
void SolutionSet::sort(Comparator &comparator) {
std::sort(solutionsList_->begin(), solutionsList_->end(), &comparator::compare);
}
The comparator param is a…