We no longer need to duplicate std::hash<wxString>

This commit is contained in:
Paul Licameli 2021-01-31 08:26:26 -05:00
parent 21296b0cf1
commit 98223f9850
1 changed files with 0 additions and 16 deletions

View File

@ -48,22 +48,6 @@
#include <vector>
#include <wx/debug.h> // for wxASSERT
#include <wx/string.h> // type used in inline function and member variable
#include <wx/version.h> // for wxCHECK_VERSION
#if !wxCHECK_VERSION(3, 1, 0)
// For using std::unordered_map on wxString
namespace std
{
template<> struct hash< wxString > {
size_t operator () (const wxString &str) const // noexcept
{
auto stdstr = str.ToStdWstring(); // no allocations, a cheap fetch
using Hasher = hash< decltype(stdstr) >;
return Hasher{}( stdstr );
}
};
}
#endif
// ----------------------------------------------------------------------------
// TODO: I'd imagine this header may be replaced by other public headers. But,