summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2021-10-28 03:52:21 -0400
committerGravatar Morph2021-10-28 03:52:21 -0400
commit189927c237cc4cfd38af2da5f25891c30d84e6dc (patch)
treecb4bb570f51aed39c4242d39ad68c0f3accaf9ed
parentMerge pull request #7186 from MightyCreak/fix-crash-configure-window (diff)
downloadyuzu-189927c237cc4cfd38af2da5f25891c30d84e6dc.tar.gz
yuzu-189927c237cc4cfd38af2da5f25891c30d84e6dc.tar.xz
yuzu-189927c237cc4cfd38af2da5f25891c30d84e6dc.zip
hle/result: Add move assignment operator in ResultVal
ResultVal was missing a move assignment operator, add it.
-rw-r--r--src/core/hle/result.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index a755008d5..ffef46794 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -244,6 +244,26 @@ public:
244 return *this; 244 return *this;
245 } 245 }
246 246
247 ResultVal& operator=(ResultVal&& o) {
248 if (this == &o) {
249 return *this;
250 }
251 if (!empty()) {
252 if (!o.empty()) {
253 object = std::move(o.object);
254 } else {
255 object.~T();
256 }
257 } else {
258 if (!o.empty()) {
259 new (&object) T(std::move(o.object));
260 }
261 }
262 result_code = o.result_code;
263
264 return *this;
265 }
266
247 /** 267 /**
248 * Replaces the current result with a new constructed result value in-place. The code must not 268 * Replaces the current result with a new constructed result value in-place. The code must not
249 * be an error code. 269 * be an error code.