diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-04-24 21:29:02 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-04-24 23:14:38 +0200 |
| commit | 764a1cc30404861757d9a99e7f0e20341d6ea353 (patch) | |
| tree | 2b1f711de258a4396eaf6c2012e3124bb796681b /src | |
| parent | ec520e1a5ed27b3eb414627acf7ad7f9cd661346 (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 () {} |
