aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory/qv4heap_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-02-13 08:29:56 +0100
committerLars Knoll <lars.knoll@digia.com>2015-03-20 11:16:50 +0000
commit2a4e835a7de4019b8ab44067566e4f6eba0fa370 (patch)
treec2736e7797e939c8dc892284e9a9077b3f59b080 /src/qml/memory/qv4heap_p.h
parent3a41146b7864e8477b1f04d020725c008f86f3bc (diff)
Wrap members in Object in a Heap::Pointer
Change-Id: I0d132592487255027c215da21fbec15b23b00624 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/memory/qv4heap_p.h')
-rw-r--r--src/qml/memory/qv4heap_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/memory/qv4heap_p.h b/src/qml/memory/qv4heap_p.h
index 96d73766d0..3a7885467d 100644
--- a/src/qml/memory/qv4heap_p.h
+++ b/src/qml/memory/qv4heap_p.h
@@ -96,6 +96,9 @@ struct Pointer {
Pointer &operator =(T *t) { ptr = t; return *this; }
+ template <typename Type>
+ Type *as() { return static_cast<Type *>(ptr); }
+
// Use Base, not T here, to ensure T inherits from ptr
Base *ptr;
};