summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 19:48:50 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 19:48:50 +0100
commit3c0d819176620f118b04931e8444e03f62577faf (patch)
treefe1458232d8e33bcd8a09c22ce609a34f83ed252 /include
parent51f4788b2b51a21894ae49821abc67c2fab4a68a (diff)
added copy and move constructors to some classes
Diffstat (limited to 'include')
-rw-r--r--include/class.h12
-rw-r--r--include/classbase.h15
2 files changed, 20 insertions, 7 deletions
diff --git a/include/class.h b/include/class.h
index 61d5856..851de8d 100644
--- a/include/class.h
+++ b/include/class.h
@@ -42,7 +42,17 @@ public:
*/
Class(const char *name) : ClassBase(name) {}
- // @todo add copy and move constructor
+ /**
+ * Copy constructor
+ * @param that
+ */
+ Class(const Class<T> &that) : ClassBase(that) {}
+
+ /**
+ * Move constructor
+ * @param that
+ */
+ Class(Class<T> &&that) : ClassBase(std::move(that)) {}
/**
* Destructor
diff --git a/include/classbase.h b/include/classbase.h
index e664105..baa1624 100644
--- a/include/classbase.h
+++ b/include/classbase.h
@@ -50,20 +50,23 @@ public:
/**
* Copy constructor
* @param that
- *
- * @todo prefer move
*/
ClassBase(const ClassBase &that) :
- _name(that._name), _type(that._type), _methods(that._methods),
- _members(that._members), _entry(nullptr) {}
+ _name(that._name),
+ _type(that._type),
+ _methods(that._methods),
+ _members(that._members),
+ _entry(nullptr) {}
/**
* Move constructor
* @param that
*/
ClassBase(ClassBase &&that) :
- _name(std::move(that._name)), _type(that._type),
- _methods(std::move(that._methods)), _members(std::move(that._members)),
+ _name(std::move(that._name)),
+ _type(that._type),
+ _methods(std::move(that._methods)),
+ _members(std::move(that._members)),
_entry(that._entry)
{
// other entry are invalid now (not that it is used..., class objects are