Define sortByParams as a local class

This commit is contained in:
Tiago Gomes 2013-02-22 12:35:14 +00:00
parent 0991a84793
commit c8b639f495

View File

@ -118,9 +118,10 @@ ParfactorList::isAllShattered (void) const
namespace { void
ParfactorList::print (void) const
struct sortByParams { {
struct sortByParams {
bool operator() (const Parfactor* pf1, const Parfactor* pf2) bool operator() (const Parfactor* pf1, const Parfactor* pf2)
{ {
if (pf1->params().size() < pf2->params().size()) { if (pf1->params().size() < pf2->params().size()) {
@ -131,15 +132,7 @@ struct sortByParams {
} }
return false; return false;
} }
}; };
}
void
ParfactorList::print (void) const
{
Parfactors pfVec (pfList_.begin(), pfList_.end()); Parfactors pfVec (pfList_.begin(), pfList_.end());
std::sort (pfVec.begin(), pfVec.end(), sortByParams()); std::sort (pfVec.begin(), pfVec.end(), sortByParams());
for (size_t i = 0; i < pfVec.size(); i++) { for (size_t i = 0; i < pfVec.size(); i++) {