Changeset View
Changeset View
Standalone View
Standalone View
src/shared/akstd.h
Show All 23 Lines | |||||
24 | 24 | | |||
25 | #include <QString> | 25 | #include <QString> | ||
26 | #include <QHash> | 26 | #include <QHash> | ||
27 | 27 | | |||
28 | /// A glue between Qt and the standard library | 28 | /// A glue between Qt and the standard library | ||
29 | 29 | | |||
30 | namespace std { | 30 | namespace std { | ||
31 | 31 | | |||
32 | #if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) | ||||
32 | template<> | 33 | template<> | ||
33 | struct hash<QString> { | 34 | struct hash<QString> { | ||
34 | using argument_type = QString; | 35 | using argument_type = QString; | ||
35 | using result_type = std::size_t; | 36 | using result_type = std::size_t; | ||
36 | 37 | | |||
37 | result_type operator()(const QString &s) const noexcept | 38 | result_type operator()(const QString &s) const noexcept | ||
38 | { | 39 | { | ||
39 | return qHash(s); | 40 | return qHash(s); | ||
40 | } | 41 | } | ||
41 | }; | 42 | }; | ||
43 | #endif | ||||
42 | 44 | | |||
43 | } | 45 | } | ||
44 | 46 | | |||
45 | #endif | 47 | #endif |