1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef HASHSET_H
4#define HASHSET_H
5
6#include <QtCore/qset.h>
7
8namespace WTF {
9
10template<typename Key>
11class HashSet final : public QSet<Key>
12{
13public:
14 struct SetAddResult {
15 bool isNewEntry;
16 };
17 SetAddResult add(const Key &k)
18 {
19 if (QSet<Key>::find(k) == QSet<Key>::constEnd()) {
20 QSet<Key>::insert(k);
21 return { true };
22 }
23 return { false };
24 }
25};
26
27}
28
29using WTF::HashSet;
30
31#endif
32

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtdeclarative/src/3rdparty/masm/stubs/wtf/HashSet.h