mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +02:00
lib-strings: Make hashing compatible with wx3.0
3.0 doesn't have direct wxString hash support yet, so lift an earlier version of this from the history, which was used in TranslatableString.h before and use it again. wxWidgets version is slightly different though. Signed-off-by: Mart Raudsepp <leio@gentoo.org>
This commit is contained in:
parent
f6b0cd343c
commit
c8db3ab3ac
@ -90,6 +90,20 @@ inline bool operator <= ( const Identifier &x, const Identifier &y )
|
||||
inline bool operator >= ( const Identifier &x, const Identifier &y )
|
||||
{ return !(x < y); }
|
||||
|
||||
#if !wxCHECK_VERSION(3, 1, 0)
|
||||
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
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<> struct hash< Identifier > {
|
||||
|
@ -18,6 +18,7 @@
|
||||
class Identifier;
|
||||
|
||||
#include <vector>
|
||||
#include "Identifier.h"
|
||||
|
||||
//! Holds a msgid for the translation catalog; may also bind format arguments
|
||||
/*!
|
||||
|
Loading…
x
Reference in New Issue
Block a user