diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2018-07-23 21:42:00 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2018-07-23 21:42:00 -0700 |
commit | a09abace8d4ec0d2fc9bb65493dfae7b7ce8e0fe (patch) | |
tree | f264e91c74d2e033c4e8474e377c9af36ac5c6f9 /src/Uri.cpp | |
parent | c2dade7a5a0b4e8317e8eb6f249cef91eb54cc1a (diff) |
Add copy constructor and assignment operator
Diffstat (limited to 'src/Uri.cpp')
-rw-r--r-- | src/Uri.cpp | 11 |
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) |