diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-14 13:03:46 +0100 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-19 13:53:21 +0100 |
commit | 26e876912435bdafbca2b425af43824d7ec5b876 (patch) | |
tree | b7ee83cdd9de18ce5970bab0bb217a972d3d2445 /src/corelib/tools/qmap.h | |
parent | 7a6c6da2ebbfef33f7284ce5c96aa0c3acabc6bc (diff) | |
parent | bac999f38ca10147832846f6d7df1e4a051d3760 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
Diffstat (limited to 'src/corelib/tools/qmap.h')
-rw-r--r-- | src/corelib/tools/qmap.h | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 18c681581f..f169ed5e49 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -219,7 +219,7 @@ struct QMapData : public QMapDataBase Node *createNode(const Key &k, const T &v, Node *parent = nullptr, bool left = false) { - Node *n = static_cast<Node *>(QMapDataBase::createNode(sizeof(Node), Q_ALIGNOF(Node), + Node *n = static_cast<Node *>(QMapDataBase::createNode(sizeof(Node), alignof(Node), parent, left)); QT_TRY { new (&n->key) Key(k); @@ -243,7 +243,7 @@ struct QMapData : public QMapDataBase void destroy() { if (root()) { root()->destroySubTree(); - freeTree(header.left, Q_ALIGNOF(Node)); + freeTree(header.left, alignof(Node)); } freeData(this); } @@ -356,17 +356,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 == d->ref.isSharable()) - return; - if (!sharable) - detach(); - // Don't call on shared_null - d->ref.setSharable(sharable); - } -#endif inline bool isSharedWith(const QMap<Key, T> &other) const { return d == other.d; } void clear(); @@ -444,13 +433,8 @@ public: inline iterator &operator-=(int j) { return *this = *this - j; } friend inline iterator operator+(int j, iterator k) { return k + j; } -#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 QMap<Key, T>; }; friend class iterator; @@ -469,12 +453,7 @@ public: Q_DECL_CONSTEXPR inline const_iterator() : i(nullptr) { } inline const_iterator(const Node *node) : i(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_iterator(const iterator &o) { i = o.i; } inline const Key &key() const { return i->key; } inline const T &value() const { return i->value; } @@ -508,11 +487,6 @@ public: inline const_iterator &operator-=(int j) { return *this = *this - j; } friend inline const_iterator operator+(int j, const_iterator k) { return k + j; } -#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 QMap<Key, T>; }; friend class const_iterator; |