diff options
Diffstat (limited to 'include/class.h')
-rw-r--r-- | include/class.h | 14 |
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; |