diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-20 12:50:42 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-20 12:50:42 +0100 |
commit | 4bef3b094733b38bf75f2a1837d353f5c09bec00 (patch) | |
tree | d221f8aeee35acd6eebbbd8b7c7aa8184d90f71d /src/core/managed | |
parent | 403fbc4552822af899d85ba97ada2559eb776ea8 (diff) |
find method for ManagedContainer.
Diffstat (limited to 'src/core/managed')
-rw-r--r-- | src/core/managed/ManagedContainer.hpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/core/managed/ManagedContainer.hpp b/src/core/managed/ManagedContainer.hpp index bdab38f..ba9d488 100644 --- a/src/core/managed/ManagedContainer.hpp +++ b/src/core/managed/ManagedContainer.hpp @@ -322,7 +322,7 @@ public: ManagedContainer(own_type &&other) : owner(other.owner), c(std::move(other.c)) { - //other.owner = nullptr; + // other.owner = nullptr; } /** @@ -338,7 +338,7 @@ public: { initialize(); other.finalize(c); - //other.owner = nullptr; + // other.owner = nullptr; } /** @@ -356,7 +356,7 @@ public: { initialize(); other.finalize(c); - //other.owner = nullptr; + // other.owner = nullptr; } /** @@ -413,7 +413,7 @@ public: finalize(); owner = other.owner; c = std::move(other.c); - //other.owner = nullptr; + // other.owner = nullptr; return *this; } @@ -529,6 +529,18 @@ public: } return c.erase(first, last); } + + iterator find(Handle<Managed> elem) + { + iterator it = begin(); + while (it != end()) { + if (*it == elem) { + break; + } + it++; + } + return it; + } }; /** |