From a09abace8d4ec0d2fc9bb65493dfae7b7ce8e0fe Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Mon, 23 Jul 2018 21:42:00 -0700 Subject: Add copy constructor and assignment operator --- src/Uri.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') 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) -- cgit v1.2.3