summaryrefslogtreecommitdiff
path: root/include/class.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-09 22:37:41 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-09 22:37:41 +0100
commit49d88d98a0656233f15923d31ea67a1ed229e514 (patch)
tree04bb753e4d5434c46bd90048e52d22260052334d /include/class.h
parentbdca5b0454534413f10d13211885c086fafff35a (diff)
work in progress on iterators
Diffstat (limited to 'include/class.h')
-rw-r--r--include/class.h14
1 files changed, 12 insertions, 2 deletions
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;
@@ -175,6 +175,16 @@ private:
}
/**
+ * 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<Traversable,T>::value;
+ }
+
+ /**
* Namespaces have access to the private base class
*/
friend class Namespace;