summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qhash.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qhash.h')
-rw-r--r--src/corelib/tools/qhash.h25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 0b8a0b283d..c56324eef7 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -235,7 +235,7 @@ class QHash
return reinterpret_cast<Node *>(node);
}
- static inline int alignOfNode() { return qMax<int>(sizeof(void*), Q_ALIGNOF(Node)); }
+ static inline int alignOfNode() { return qMax<int>(sizeof(void*), alignof(Node)); }
public:
inline QHash() noexcept : d(const_cast<QHashData *>(&QHashData::shared_null)) { }
@@ -290,9 +290,6 @@ public:
inline void detach() { if (d->ref.isShared()) detach_helper(); }
inline bool isDetached() const { return !d->ref.isShared(); }
-#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
- inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QHashData::shared_null) d->sharable = sharable; }
-#endif
bool isSharedWith(const QHash &other) const { return d == other.d; }
void clear();
@@ -376,13 +373,8 @@ public:
friend inline QT_DEPRECATED iterator operator+(int j, iterator k) { return k + j; }
#endif
-#ifndef QT_STRICT_ITERATORS
- public:
- inline bool operator==(const const_iterator &o) const
- { return i == o.i; }
- inline bool operator!=(const const_iterator &o) const
- { return i != o.i; }
-#endif
+ inline bool operator==(const const_iterator &o) const { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const { return i != o.i; }
};
friend class iterator;
@@ -408,11 +400,7 @@ public:
Q_DECL_CONSTEXPR inline const_iterator() : i(nullptr) { }
explicit inline const_iterator(void *node)
: i(reinterpret_cast<QHashData::Node *>(node)) { }
-#ifdef QT_STRICT_ITERATORS
- explicit inline const_iterator(const iterator &o)
-#else
inline const_iterator(const iterator &o)
-#endif
{ i = o.i; }
inline const Key &key() const { return concrete(i)->key; }
@@ -453,13 +441,6 @@ public:
return k + j;
}
#endif
-
- // ### Qt 5: not sure this is necessary anymore
-#ifdef QT_STRICT_ITERATORS
- private:
- inline bool operator==(const iterator &o) const { return operator==(const_iterator(o)); }
- inline bool operator!=(const iterator &o) const { return operator!=(const_iterator(o)); }
-#endif
};
friend class const_iterator;