From 93c065174e1aa306ee724dd523ef6b2254c1d388 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Wed, 17 Dec 2014 17:11:51 +0100 Subject: Some (slight) changes to existing structures and first attempts on a test to construct a test comain and a test document out of thin air. I am, indeed, an alchemist. --- src/core/managed/ManagedContainer.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/managed/ManagedContainer.hpp') diff --git a/src/core/managed/ManagedContainer.hpp b/src/core/managed/ManagedContainer.hpp index 19bff3f..6bf1915 100644 --- a/src/core/managed/ManagedContainer.hpp +++ b/src/core/managed/ManagedContainer.hpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "Manager.hpp" @@ -496,6 +497,16 @@ public: } Base::c.pop_back(); } + + Rooted operator[](int i) const { + for (const_iterator it = Base::cbegin(); it != Base::cend(); it++) { + if (i == 0) { + return Rooted(*it); + } + i--; + } + throw std::out_of_range(std::to_string(i) + " is out of range!"); + } }; /** -- cgit v1.2.3