From 4bef3b094733b38bf75f2a1837d353f5c09bec00 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Tue, 20 Jan 2015 12:50:42 +0100 Subject: find method for ManagedContainer. --- src/core/managed/ManagedContainer.hpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/core/managed') 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 elem) + { + iterator it = begin(); + while (it != end()) { + if (*it == elem) { + break; + } + it++; + } + return it; + } }; /** -- cgit v1.2.3