diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-16 12:29:30 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-16 12:29:30 +0100 |
commit | 7bdaa89ccef864d36f1e1adce535179d9e5fadce (patch) | |
tree | cbf83a9ebd7e0348847b6e2006f8538ae6330482 | |
parent | 0b76b4943b53b7b42500f15afc45f7eb38d8734b (diff) |
made getUid work using a rather ugly const cast. Unfortunately this could not be prevented.
-rw-r--r-- | src/core/managed/Managed.hpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/managed/Managed.hpp b/src/core/managed/Managed.hpp index 48198c2..e98e95e 100644 --- a/src/core/managed/Managed.hpp +++ b/src/core/managed/Managed.hpp @@ -99,7 +99,17 @@ public: * * @return the unique id of the object. */ - ManagedUid getUid() { return mgr.getUid(this); } + ManagedUid getUid() const + { + /* + * Dear Bjarne Stroustroup, dear gods of C++, please excuse this + * const_cast, for I did try other means but was not able to apply them + * and in my despair turned to this folly, this ugliness, this heresy! + * I pledge my life to better programming and promise that this cast + * will do no harm to anyone. + */ + return mgr.getUid(const_cast<Managed *>(this)); + } /** * Acquires a reference to the object wraped in the given handle -- creates |