diff --git a/src/tl/tl/tlHash.h b/src/tl/tl/tlHash.h index f9c135eb2..82b379a92 100644 --- a/src/tl/tl/tlHash.h +++ b/src/tl/tl/tlHash.h @@ -348,21 +348,28 @@ namespace std } }; -#if defined(HAVE_QT) && QT_VERSION < 0x050000 +#if defined(HAVE_QT) + + /** + * @brief Generic hash for QChar + */ + + template <> + inline size_t hfunc (const QChar &o, size_t h) + { + return hcombine (h, size_t (o.unicode ())); + } + + template <> + inline size_t hfunc (const QChar &o) + { + return size_t (o.unicode ()); + } /** * @brief Generic hash for QString */ - template <> - struct hash - { - size_t operator() (const QChar &o) const - { - return hfunc (o.unicode ()); - } - }; - template <> inline size_t hfunc (const QString &o, size_t h) { @@ -375,15 +382,6 @@ namespace std return hfunc (o, size_t (0)); } - template <> - struct hash - { - size_t operator() (const QString &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for QByteArray */ @@ -400,15 +398,6 @@ namespace std return hfunc (o, size_t (0)); } - template <> - struct hash - { - size_t operator() (const QString &o) const - { - return hfunc (o); - } - }; - #endif }