summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qmap.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 3f4f034b4e..da77ba4458 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -209,8 +209,10 @@ struct QMapData : public QMapDataBase
Node *root() const { return static_cast<Node *>(header.left); }
- const Node *end() const { return static_cast<const Node *>(&header); }
- Node *end() { return static_cast<Node *>(&header); }
+ // using reinterpret_cast because QMapDataBase::header is not
+ // actually a QMapNode.
+ const Node *end() const { return reinterpret_cast<const Node *>(&header); }
+ Node *end() { return reinterpret_cast<Node *>(&header); }
const Node *begin() const { if (root()) return static_cast<const Node*>(mostLeftNode); return end(); }
Node *begin() { if (root()) return static_cast<Node*>(mostLeftNode); return end(); }