Move comparison helper class to generic header

This class wraps the comparison function in a way that is compatible with
std::map and std::set. This, too is generally useful, so it should be moved
to the generic header.

At the same time, the criterium for less-than is changed from "equal to -1"
to "smaller than 0", because technically the comparison function may return
other values.
This commit is contained in:
Simon Richter 2016-01-13 14:09:18 -05:00 committed by Chris Pavlina
parent 88ccd787a4
commit a7b102c366
1 changed files with 1 additions and 12 deletions

View File

@ -284,17 +284,6 @@ unsigned int DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::GetChildren( const wxData
}
namespace {
class CompareLess
{
public:
bool operator()( const wxString& lhs, const wxString& rhs )
{
return PinNumbers::Compare( lhs, rhs ) == -1;
}
};
}
int DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Compare( const wxDataViewItem& aItem1,
const wxDataViewItem& aItem2,
unsigned int aCol,
@ -398,7 +387,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Group::GetValue( wxVariant& aValu
}
else
{
std::set<wxString, CompareLess> values;
std::set<wxString, PinNumbers::less> values;
for( std::list<Pin*>::const_iterator i = m_Members.begin(); i != m_Members.end(); ++i )
{