Add std::hash instance for String (for wxWidgets < 3.1)

This commit is contained in:
Twan van Laarhoven
2021-07-03 23:11:35 +02:00
parent 5e50cb4c56
commit b3220cc302
+11
View File
@@ -33,6 +33,17 @@ inline wxStdString const& toStdString(String const& s) {
#endif
}
#if wxVERSION_NUMBER < 3100
// wxWidgets 3.1.0 added this specialization
namespace std {
template<> struct hash<String> {
size_t operator()(String const& s) const {
return std::hash<std::wstring>()(s.ToStdWstring());
}
};
} //
#endif
// ----------------------------------------------------------------------------- : Unicode
/// u if UNICODE is defined, a otherwise