diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-11-13 16:42:36 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-11-13 16:42:36 +0100 |
commit | a994f02d3c204731a0e811ce9454e6bb0f1dc1e8 (patch) | |
tree | 9af17530e887c59e1fe61d3fc3b70f93455b5e96 /src/core | |
parent | 212ee73e4d810679388cf988f125c3e86c5806b3 (diff) |
allow the Handle class to be converted to const pointers
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/dom/Managed.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/dom/Managed.hpp b/src/core/dom/Managed.hpp index 4c8f951..aab18a5 100644 --- a/src/core/dom/Managed.hpp +++ b/src/core/dom/Managed.hpp @@ -372,11 +372,21 @@ public: T *operator->() { return ptr; } /** + * Provides access to the underlying managed object for immutable handles. + */ + const T *operator->() const { return ptr; } + + /** * Provides access to the underlying managed object. */ T &operator*() { return *ptr; } /** + * Provides access to the underlying managed object for immutable handles. + */ + const T &operator*() const { return *ptr; } + + /** * Comparison operator between base Owned and base Owned. */ bool operator==(const Handle &h) const { return ptr == h.ptr; } @@ -676,6 +686,7 @@ public: */ Managed *getOwner() const { return owner; } }; + } } |