summaryrefslogtreecommitdiff
path: root/src/core/dom/Managed.hpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-11-14 01:23:12 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-11-14 01:23:12 +0100
commit8c7531643c1407c785f517116dba1e7bd04f70d3 (patch)
tree7e0c109c72d58f33bdd6e454d9391175ecd829be /src/core/dom/Managed.hpp
parent8ae1ca37ae7b3e5443221908e7ca2a38a70c96ed (diff)
fixed equals operator in Handle class when comparing Handles of different types
Diffstat (limited to 'src/core/dom/Managed.hpp')
-rw-r--r--src/core/dom/Managed.hpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/core/dom/Managed.hpp b/src/core/dom/Managed.hpp
index aab18a5..deccb99 100644
--- a/src/core/dom/Managed.hpp
+++ b/src/core/dom/Managed.hpp
@@ -389,22 +389,23 @@ public:
/**
* Comparison operator between base Owned and base Owned.
*/
- bool operator==(const Handle &h) const { return ptr == h.ptr; }
+ template<class T2>
+ bool operator==(const Handle<T2> &h) const { return ptr == h.get(); }
/**
* Comparison operator between base Owned and pointer.
*/
- friend bool operator==(const Handle &h, const Managed *o)
+ friend bool operator==(const Handle<T> &h, const Managed *o)
{
- return h.ptr == o;
+ return h.get() == o;
}
/**
* Comparison operator between base Owned and pointer.
*/
- friend bool operator==(const Managed *o, const Handle &h)
+ friend bool operator==(const Managed *o, const Handle<T> &h)
{
- return h.ptr == o;
+ return o == h.get();
}
/**
@@ -419,11 +420,6 @@ public:
};
/**
- * Null represents a null handle.
- */
-static const Handle<Managed> Null{nullptr};
-
-/**
* A Rooted represents a directed, garbage collected pointer at a managed
* object. The lifetime of the represented managed object is guaranteed to be at
* least as long as the lifetime of the Rooted handle instance.