aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Walters <rwalters@digitalstirling.com>2018-07-23 21:42:00 -0700
committerRichard Walters <rwalters@digitalstirling.com>2018-07-23 21:42:00 -0700
commita09abace8d4ec0d2fc9bb65493dfae7b7ce8e0fe (patch)
treef264e91c74d2e033c4e8474e377c9af36ac5c6f9 /src
parentc2dade7a5a0b4e8317e8eb6f249cef91eb54cc1a (diff)
Add copy constructor and assignment operator
Diffstat (limited to 'src')
-rw-r--r--src/Uri.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Uri.cpp b/src/Uri.cpp
index 73bdfc3..cb44c1e 100644
--- a/src/Uri.cpp
+++ b/src/Uri.cpp
@@ -1217,8 +1217,19 @@ namespace Uri {
};
Uri::~Uri() = default;
+ Uri::Uri(const Uri& other)
+ : impl_(new Impl)
+ {
+ *this = other;
+ }
Uri::Uri(Uri&&) = default;
Uri& Uri::operator=(Uri&&) = default;
+ Uri& Uri::operator=(const Uri& other) {
+ if (this != &other) {
+ *impl_ = *other.impl_;
+ }
+ return *this;
+ }
Uri::Uri()
: impl_(new Impl)