From 764a1cc30404861757d9a99e7f0e20341d6ea353 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 24 Apr 2022 21:29:02 +0200 Subject: Add copy constructor for Object. --- src/object.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/object.h') diff --git a/src/object.h b/src/object.h index d1d476c8..89da0fd8 100644 --- a/src/object.h +++ b/src/object.h @@ -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 () {} -- cgit v1.2.3