util/Error: remove explicit move constructor, allow copying

The C++ compiler will auto-generate move and copy
constructors/operators for us.
This commit is contained in:
Max Kellermann 2016-09-08 10:33:31 +02:00
parent aca081557a
commit 06909f4f00

View File

@ -75,22 +75,8 @@ public:
Error(const Domain &_domain, const char *_message)
:domain(&_domain), code(0), message(_message) {}
Error(Error &&other)
:domain(other.domain), code(other.code),
message(std::move(other.message)) {}
~Error();
Error(const Error &) = delete;
Error &operator=(const Error &) = delete;
Error &operator=(Error &&other) {
domain = other.domain;
code = other.code;
std::swap(message, other.message);
return *this;
}
bool IsDefined() const {
return domain != nullptr;
}