summaryrefslogtreecommitdiffhomepage
path: root/compat/qhash.hpp
blob: 83b154f477c1a9ef622e1e27147b34c62b6c9922 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include <functional>

#include <QtGlobal>
#include <QString>
#include <QHashFunctions>

#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)

#include <cstdlib>

namespace std {
template<> struct hash<QString>
{
    using argument_type = QString;
    using result_type = std::size_t;

    std::size_t operator()(const QString& value) const noexcept
    {
        return qHash(value);
    }
};

template class hash<QString>;
}

#endif