Add copy constructor for Object.
authorCarl Hetherington <cth@carlh.net>
Sun, 24 Apr 2022 19:29:02 +0000 (21:29 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 24 Apr 2022 19:29:02 +0000 (21:29 +0200)
src/object.h

index d1d476c8caba7fb332702927048943cc813b1923..89da0fd8d7e36cae534ff2b1b25c35e8a1708a21 100644 (file)
@@ -70,8 +70,14 @@ public:
         */
        explicit Object (std::string id);
 
-       Object (Object const&) = delete;
-       Object& operator= (Object const&) = delete;
+       Object(Object const& other)
+               : _id(other._id)
+       {}
+
+       Object& operator=(Object const& other) {
+               _id = other._id;
+               return *this;
+       }
 
        virtual ~Object () {}