We no longer need to duplicate std::hash<wxString>
This commit is contained in:
parent
21296b0cf1
commit
98223f9850
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue