mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 18:08:53 +00:00
fixed move assignment operator for expected (#4906)
This commit is contained in:
parent
82ee1b9a43
commit
5ef2375a17
@ -104,7 +104,17 @@ class Expected final {
|
||||
Expected(const Expected&) = delete;
|
||||
Expected(ErrorBase* error) = delete;
|
||||
|
||||
Expected& operator=(Expected&& other) = default;
|
||||
Expected& operator=(Expected&& other) {
|
||||
if (this != &other) {
|
||||
errorChecked_.verify("Error was not checked");
|
||||
|
||||
object_ = std::move(other.object_);
|
||||
errorChecked_ = other.errorChecked_;
|
||||
other.errorChecked_ = true;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Expected& operator=(const Expected& other) = delete;
|
||||
|
||||
~Expected() {
|
||||
|
Loading…
Reference in New Issue
Block a user