From 49d88d98a0656233f15923d31ea67a1ed229e514 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Sun, 9 Mar 2014 22:37:41 +0100 Subject: work in progress on iterators --- include/class.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'include/class.h') diff --git a/include/class.h b/include/class.h index e9a7179..6bcefda 100644 --- a/include/class.h +++ b/include/class.h @@ -154,7 +154,7 @@ private: * Construct a new instance of the object * @return Base */ - virtual Base* construct() override + virtual Base* construct() const override { // construct an instance return new T(); @@ -165,7 +165,7 @@ private: * @param orig * @return Base */ - virtual Base *clone(Base *orig) override + virtual Base *clone(Base *orig) const override { // cast to the original object T *t = (T *)orig; @@ -174,6 +174,16 @@ private: return new T(*t); } + /** + * Is this class traversable? + * @return bool + */ + virtual bool traversable() const override + { + // check if the templated class overrides from the base + return std::is_base_of::value; + } + /** * Namespaces have access to the private base class */ -- cgit v1.2.3