diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-04-24 21:29:02 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-04-24 21:29:02 +0200 |
| commit | fedc40304c498be386420b714cebbe9aa3b72fb9 (patch) | |
| tree | bc3794a02915411e1fb307ec8a30821cf103ece0 /src | |
| parent | 62ccbf5db9eb2ddbbca63af21d94bb76a2169db6 (diff) | |
Add copy constructor for Object.
Diffstat (limited to 'src')
| -rw-r--r-- | src/object.h | 10 |
1 files changed, 8 insertions, 2 deletions
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 () {} |
