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:
parent
aca081557a
commit
06909f4f00
@ -75,22 +75,8 @@ public:
|
|||||||
Error(const Domain &_domain, const char *_message)
|
Error(const Domain &_domain, const char *_message)
|
||||||
:domain(&_domain), code(0), message(_message) {}
|
:domain(&_domain), code(0), message(_message) {}
|
||||||
|
|
||||||
Error(Error &&other)
|
|
||||||
:domain(other.domain), code(other.code),
|
|
||||||
message(std::move(other.message)) {}
|
|
||||||
|
|
||||||
~Error();
|
~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 {
|
bool IsDefined() const {
|
||||||
return domain != nullptr;
|
return domain != nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user