Added std::less specialization for wxPoint

Requried to use wxPoint as key type in maps
This commit is contained in:
Maciej Suminski 2018-04-12 18:09:18 +02:00
parent f42ca89bb4
commit b766dbc7a4
2 changed files with 15 additions and 0 deletions

View File

@ -386,3 +386,12 @@ size_t std::hash<wxString>::operator()( const wxString& s ) const
return std::hash<std::wstring>{}( s.ToStdWstring() );
}
#endif
bool std::less<wxPoint>::operator()( const wxPoint& aA, const wxPoint& aB ) const
{
if( aA.x == aB.x )
return aA.y < aB.y;
return aA.x < aB.x;
}

View File

@ -355,6 +355,12 @@ namespace std
{
size_t operator()( const wxString& s ) const;
};
template<> struct std::less<wxPoint>
{
bool operator()( const wxPoint& aA, const wxPoint& aB ) const;
};
}
#endif